Этот коммит содержится в:
Christopher Speller
2017-04-24 12:40:17 -04:00
коммит произвёл GitHub
родитель 3b7dc2c477
Коммит 134f78e630

Просмотреть файл

@@ -4,10 +4,11 @@
package app package app
import ( import (
"net/http"
"github.com/mattermost/platform/einterfaces" "github.com/mattermost/platform/einterfaces"
"github.com/mattermost/platform/model" "github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils" "github.com/mattermost/platform/utils"
"net/http"
l4g "github.com/alecthomas/log4go" l4g "github.com/alecthomas/log4go"
) )
@@ -47,7 +48,7 @@ func GetSession(token string) (*model.Session, *model.AppError) {
} else { } else {
session = sessionResult.Data.(*model.Session) session = sessionResult.Data.(*model.Session)
if session.IsExpired() || session.Token != token { if session == nil || session.IsExpired() || session.Token != token {
return nil, model.NewLocAppError("GetSession", "api.context.invalid_token.error", map[string]interface{}{"Token": token, "Error": sessionResult.Err.DetailedError}, "") return nil, model.NewLocAppError("GetSession", "api.context.invalid_token.error", map[string]interface{}{"Token": token, "Error": sessionResult.Err.DetailedError}, "")
} else { } else {
AddSessionToCache(session) AddSessionToCache(session)