From 1306ea3c5cbd56b144c3849b97569c55f988881f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 28 Feb 2024 17:41:48 -0500 Subject: [PATCH] Logging null templates --- src/engine/objects/ItemBase.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index d10cd932..e2bedccb 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -181,7 +181,10 @@ public class ItemBase { ItemTemplate template = ItemTemplate.itemTemplates.get(itemBase.uuid); - _IDsByNames.put(template.item_base_name.toLowerCase().replace(" ", "_"), itemBase.uuid); + if (template == null) + Logger.error("Null template for: " + itemBase.uuid); + else + _IDsByNames.put(template.item_base_name.toLowerCase().replace(" ", "_"), itemBase.uuid); } public static HashMap getItemHashIDMap() {