Fix NullPointerException in RoomRelativeMapComposer

This commit is contained in:
Alejandro 2019-05-26 21:49:15 +03:00
parent 7e9eb84d39
commit 766fa148d0
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ public class UpdateItemsCommand extends Command {
synchronized (Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
for (Room room : Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
if (room.isLoaded() && room.getUserCount() > 0) {
if (room.isLoaded() && room.getUserCount() > 0 && room.getLayout() != null) {
room.sendComposer(new RoomRelativeMapComposer(room).compose());
}
}

View File

@ -12,7 +12,7 @@ public class RequestRoomHeightmapEvent extends MessageHandler {
if (this.client.getHabbo().getHabboInfo().getLoadingRoom() > 0) {
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(this.client.getHabbo().getHabboInfo().getLoadingRoom());
if (room != null) {
if (room != null && room.getLayout() != null) {
this.client.sendResponse(new RoomRelativeMapComposer(room));
this.client.sendResponse(new RoomHeightMapComposer(room));