summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHank Shen <swh@admpub.com>2022-01-20 11:19:49 +0300
committerHank Shen <swh@admpub.com>2022-01-20 11:19:49 +0300
commit2a94acab148e3f71c0cf818bfdbe4fe98cd33874 (patch)
treee638cba09574ff7c1e252ec0003ab6a65e4da5f3
parent370893cdea2cfbcc42ce82c2d5c942db4d2359dc (diff)
updatev0.1.3
-rw-r--r--sessions.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/sessions.go b/sessions.go
index 147889e..dcddc42 100644
--- a/sessions.go
+++ b/sessions.go
@@ -139,8 +139,14 @@ 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
+ if err != nil {
+ return
+ }
} else {
session, err = store.New(s.context, name)
+ if err != nil {
+ return
+ }
session.name = name
s.sessions[name] = sessionInfo{s: session, e: err}
}