aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/go-macaron/session/file.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-macaron/session/file.go')
-rw-r--r--vendor/github.com/go-macaron/session/file.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/vendor/github.com/go-macaron/session/file.go b/vendor/github.com/go-macaron/session/file.go
index 9bbc7aed..64b47f2b 100644
--- a/vendor/github.com/go-macaron/session/file.go
+++ b/vendor/github.com/go-macaron/session/file.go
@@ -81,6 +81,11 @@ func (s *FileStore) Release() error {
s.p.lock.Lock()
defer s.p.lock.Unlock()
+ // Skip encoding if the data is empty
+ if len(s.data) == 0 {
+ return nil
+ }
+
data, err := EncodeGob(s.data)
if err != nil {
return err