summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gillham <jonathan.gillham@gamil.com>2013-10-21 16:35:37 +0400
committerJonathan Gillham <jonathan.gillham@gamil.com>2013-10-21 16:35:37 +0400
commit43ff70ebcff1674fba9aff126178f93076b32718 (patch)
tree666fc39eda357997fba1f3e21ecfa833ba86db32
parentac7032cee41229d038a6c65cba4ccbedbe9268b9 (diff)
Proposed change to Registry.Get function when CookieStore.New produces
an error.
-rw-r--r--sessions.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/sessions.go b/sessions.go
index 53111b3..72b6ecb 100644
--- a/sessions.go
+++ b/sessions.go
@@ -144,7 +144,9 @@ func (s *Registry) Get(store Store, name string) (session *Session, err error) {
if info, ok := s.sessions[name]; ok {
session, err = info.s, info.e
} else {
- session, err = store.New(s.request, name)
+ if session, err = store.New(s.request, name); err != nil {
+ return
+ }
session.name = name
s.sessions[name] = sessionInfo{s: session, e: err}
}