Check dictionaries before key deletion
This commit is contained in:
parent
b5fd5947ff
commit
b0f9df9029
@ -138,9 +138,13 @@ func (m *Match) MatchLeave(ctx context.Context, logger runtime.Logger, db *sql.D
|
||||
return state
|
||||
}
|
||||
for _, presence := range presences {
|
||||
if _, ok := mState.presences[presence.GetUserId()]; ok {
|
||||
delete(mState.presences, presence.GetUserId())
|
||||
}
|
||||
if _, ok := mState.players[presence.GetUserId()]; ok {
|
||||
delete(mState.players, presence.GetUserId())
|
||||
}
|
||||
}
|
||||
return mState
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user