summaryrefslogtreecommitdiffstats
path: root/services/auth/session.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/auth/session.go')
-rw-r--r--services/auth/session.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/auth/session.go b/services/auth/session.go
index 6a23a17665..1ec94aa0af 100644
--- a/services/auth/session.go
+++ b/services/auth/session.go
@@ -39,6 +39,10 @@ func (s *Session) Verify(req *http.Request, w http.ResponseWriter, store DataSto
// SessionUser returns the user object corresponding to the "uid" session variable.
func SessionUser(sess SessionStore) *user_model.User {
+ if sess == nil {
+ return nil
+ }
+
// Get user ID
uid := sess.Get("uid")
if uid == nil {