From 0fbebc5ac83b6a434a85a67ad176cac2dd5edf65 Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Sat, 18 May 2019 18:40:45 +0300 Subject: [PATCH] Fix a NullPointerException in InteractionBattleBanzaiPuck --- .../games/battlebanzai/InteractionBattleBanzaiPuck.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiPuck.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiPuck.java index f072a6cf..7ed26f14 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiPuck.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiPuck.java @@ -140,8 +140,10 @@ public class InteractionBattleBanzaiPuck extends InteractionPushable @Override public boolean validMove(Room room, RoomTile from, RoomTile to) { + if (room == null || from == null || to == null) return false; + HabboItem topItem = room.getTopItemAt(to.x, to.y, this); - return topItem instanceof InteractionBattleBanzaiTile; + return topItem != null && topItem instanceof InteractionBattleBanzaiTile; //return !(!room.getLayout().tileWalkable(to.x, to.y) || (topItem != null && (!topItem.getBaseItem().setAllowStack() || topItem.getBaseItem().allowSit() || topItem.getBaseItem().allowLay()))); }