Fix an NPE when logging out while in a game.
The fix for #124 apparently introduced another bug wherein logging out while playing in a game caused an NPE while ensuring that the user was also not spectating the game. Hold onto that value a little bit longer to make sure we can call that method as well, even though it shouldn't need to be called at that point (but an NPE is worse).
This commit is contained in:
parent
88bfa34898
commit
0cf261f6e4
|
@ -294,8 +294,9 @@ public class User {
|
|||
*/
|
||||
public void noLongerValid() {
|
||||
if (currentGame != null) {
|
||||
currentGame.removePlayer(this);
|
||||
currentGame.removeSpectator(this);
|
||||
final Game game = currentGame;
|
||||
game.removePlayer(this);
|
||||
game.removeSpectator(this);
|
||||
}
|
||||
valid = false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue