diff --git a/src/main/java/com/comandante/creeper/command/commands/MovementCommand.java b/src/main/java/com/comandante/creeper/command/commands/MovementCommand.java index 10179d22e203fd57219e483788f3ac6aa95143ee..473ecd82061509cfa37c93fe72d46475733bcb95 100644 --- a/src/main/java/com/comandante/creeper/command/commands/MovementCommand.java +++ b/src/main/java/com/comandante/creeper/command/commands/MovementCommand.java @@ -72,6 +72,8 @@ public class MovementCommand extends Command { movement = new Movement(player, currentRoom.getRoomId(), destinationRoom.getRoomId(), this, "exited to the west."); } gameManager.movePlayer(movement); - gameManager.currentRoomLogic(movement.getPlayer().getPlayerId()); + if (movement != null) { + gameManager.currentRoomLogic(movement.getPlayer().getPlayerId()); + } } }