From c255f1e1b4a2a490e4127bfa91f20fa2d3df426e Mon Sep 17 00:00:00 2001 From: medievalshell Date: Fri, 29 May 2026 00:45:02 +0200 Subject: [PATCH] fix: guard RoomBundleLayout against null RoomManager during catalog init CatalogManager.loadFurnitureValues() (rare-values feature) iterates every catalog page during GameEnvironment.load(); for a RoomBundleLayout this calls getRoomManager().loadRoom(), but RoomManager is constructed after CatalogManager so getRoomManager() returns null -> NullPointerException -> boot aborts. Null-guard the room load so the bundle resolves lazily at runtime instead. --- .../habbohotel/catalog/layouts/RoomBundleLayout.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java index d4f6147c..1b0c475a 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java @@ -42,14 +42,18 @@ public class RoomBundleLayout extends SingleBundle { } if (this.room == null) { - if (this.roomId > 0) { - this.room = Emulator.getGameEnvironment().getRoomManager().loadRoom(this.roomId); + RoomManager roomManager = Emulator.getGameEnvironment().getRoomManager(); + if (this.roomId > 0 && roomManager != null) { + this.room = roomManager.loadRoom(this.roomId); if (this.room != null) this.room.preventUnloading = true; - } else { + } else if (this.roomId <= 0) { LOGGER.error("No room id specified for room bundle {}({})", this.getPageName(), this.getId()); } + // roomManager can be null when CatalogManager.loadFurnitureValues() runs + // during GameEnvironment.load() before RoomManager is constructed; in that + // case skip eager room loading — the bundle resolves lazily at runtime. } if (this.room == null) {