edb8bac5 by astaxie

Merge pull request #510 from jfolkins/fix_sessregenid

fix: added nil check on c.CruSession to prevent crash
2 parents a38a4f03 47d7ac06
...@@ -397,7 +397,9 @@ func (c *Controller) DelSession(name interface{}) { ...@@ -397,7 +397,9 @@ func (c *Controller) DelSession(name interface{}) {
397 // SessionRegenerateID regenerates session id for this session. 397 // SessionRegenerateID regenerates session id for this session.
398 // the session data have no changes. 398 // the session data have no changes.
399 func (c *Controller) SessionRegenerateID() { 399 func (c *Controller) SessionRegenerateID() {
400 c.CruSession.SessionRelease(c.Ctx.ResponseWriter) 400 if c.CruSession != nil {
401 c.CruSession.SessionRelease(c.Ctx.ResponseWriter)
402 }
401 c.CruSession = GlobalSessions.SessionRegenerateId(c.Ctx.ResponseWriter, c.Ctx.Request) 403 c.CruSession = GlobalSessions.SessionRegenerateId(c.Ctx.ResponseWriter, c.Ctx.Request)
402 c.Ctx.Input.CruSession = c.CruSession 404 c.Ctx.Input.CruSession = c.CruSession
403 } 405 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!