From 0cb98867eef707eefc18d7b5ffc0e8e6465fa72d Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Sat, 8 Feb 2020 18:17:02 +0200 Subject: [PATCH] Fix NPE in Game --- .../com/eu/habbo/habbohotel/games/Game.java | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/games/Game.java b/src/main/java/com/eu/habbo/habbohotel/games/Game.java index 30d97d03..b64d8292 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/Game.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/Game.java @@ -91,8 +91,11 @@ public abstract class Game implements Runnable { GameTeam team = this.getTeamForHabbo(habbo); if (team != null && team.isMember(habbo)) { - team.removeMember(habbo.getHabboInfo().getGamePlayer()); - habbo.getHabboInfo().getGamePlayer().reset(); + if (habbo.getHabboInfo().getGamePlayer() != null) { + team.removeMember(habbo.getHabboInfo().getGamePlayer()); + habbo.getHabboInfo().getGamePlayer().reset(); + } + habbo.getHabboInfo().setCurrentGame(null); habbo.getHabboInfo().setGamePlayer(null); habbo.getClient().sendResponse(new GuideSessionPartnerIsPlayingComposer(false)); @@ -101,23 +104,6 @@ public abstract class Game implements Runnable { } } } - - /* - boolean deleteGame = true; - for (GameTeam team : this.teams.values()) - { - if (team.getMembers().size() > 0 ) - { - deleteGame = false; - break; - } - } - - if (deleteGame) - { - this.room.deleteGame(this); - } - */ }