Frozen tunnels (instead of closed connection) due to an expired session

This commit is contained in:
Ev Kontsevoy 2016-07-04 16:08:58 -07:00
parent 0535b4d711
commit ddedd8b923
2 changed files with 3 additions and 2 deletions

View file

@ -332,7 +332,8 @@ func (slice Sessions) Len() int {
return len(slice)
}
// GetSession returns the session by it's id
// GetSession returns the session by it's id. Returns nil if a session
// is not found
func (s *server) GetSession(id ID) (*Session, error) {
var sess *Session
err := s.bk.GetJSONVal(activeBucket(), string(id), &sess)

View file

@ -547,7 +547,7 @@ func (s *session) removeParty(p *party) error {
log.Error(err)
return
}
if dbSession.RemoveParty(p.id) {
if dbSession != nil && dbSession.RemoveParty(p.id) {
db.UpdateSession(rsession.UpdateRequest{
ID: dbSession.ID,
Parties: &dbSession.Parties,