From 2e6d2b69a9f3cd990d02808d80b7d0403809154e Mon Sep 17 00:00:00 2001 From: Beny Date: Fri, 17 May 2019 07:33:30 +0100 Subject: [PATCH] Fixed a NullPointerException --- .../com/eu/habbo/habbohotel/rooms/Room.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 6e0243ed..a3f0048c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -1718,14 +1718,16 @@ public class Room implements Comparable, ISerialize, Runnable boolean isRiding = false; if(unit.getRoomUnitType() == RoomUnitType.USER) { Habbo rollingHabbo = this.getHabbo(unit); - RideablePet riding = rollingHabbo.getHabboInfo().getRiding(); - if(riding != null) { - RoomUnit ridingUnit = riding.getRoomUnit(); - tile.setStackHeight(ridingUnit.getZ() + zOffset); - rolledUnitIds.add(ridingUnit.getId()); - updatedUnit.remove(ridingUnit); - messages.add(new RoomUnitOnRollerComposer(ridingUnit, roller, ridingUnit.getCurrentLocation(), ridingUnit.getZ(), tile, tile.getStackHeight() + (nextTileChair != null ? -1 : 0), room)); - isRiding = true; + if(rollingHabbo != null && rollingHabbo.getHabboInfo() != null) { + RideablePet riding = rollingHabbo.getHabboInfo().getRiding(); + if (riding != null) { + RoomUnit ridingUnit = riding.getRoomUnit(); + tile.setStackHeight(ridingUnit.getZ() + zOffset); + rolledUnitIds.add(ridingUnit.getId()); + updatedUnit.remove(ridingUnit); + messages.add(new RoomUnitOnRollerComposer(ridingUnit, roller, ridingUnit.getCurrentLocation(), ridingUnit.getZ(), tile, tile.getStackHeight() + (nextTileChair != null ? -1 : 0), room)); + isRiding = true; + } } }