Skip to content

Commit

Permalink
Fix destroySession panic.
Browse files Browse the repository at this point in the history
  • Loading branch information
wubenqi committed Jan 15, 2019
1 parent 44af75a commit 14cf70a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions access/session/server/updates_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ func (m *updatesManager) onGenericSessionNew(s sessionBase) {
}

func (m *updatesManager) onGenericSessionClose(s sessionBase) {
ss := s.(*genericSession)
for e := m.genericSessions.Front(); e != nil; e = e.Next() {
if ss.SessionId() == e.Value.(*genericSession).sessionId {
m.genericSessions.Remove(e)
break
if ss, ok := s.(*genericSession); ok {
for e := m.genericSessions.Front(); e != nil; e = e.Next() {
if ss.SessionId() == e.Value.(*genericSession).sessionId {
m.genericSessions.Remove(e)
break
}
}
}
}
Expand Down

0 comments on commit 14cf70a

Please sign in to comment.