From 4985005b3edab4033265c849dbd6d7d2d149b1b4 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 30 Apr 2023 08:37:08 -0400 Subject: [PATCH] Debug null value. --- src/engine/gameManager/BuildingManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/engine/gameManager/BuildingManager.java b/src/engine/gameManager/BuildingManager.java index ee1750a0..1f2141e8 100644 --- a/src/engine/gameManager/BuildingManager.java +++ b/src/engine/gameManager/BuildingManager.java @@ -38,6 +38,14 @@ public enum BuildingManager { public static int getAvailableSlot(Building building) { + ArrayList slotLocations = _slotLocations.get(building.meshUUID); + + // Some meshes might not have slot locations assigned. + + if (slotLocations == null || + slotLocations.isEmpty()) + return -1; + int numOfSlots = _slotLocations.get(building.meshUUID).size(); for (int i = 1; i <= numOfSlots; i++) {