From 7f830a18cd18d6d7c8b78fa2365a9396e6693913 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 10 Mar 2024 13:42:25 -0400 Subject: [PATCH] Error logging addded --- src/engine/objects/ItemBase.java | 41 ++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index e4776ceb..c5bdcc2c 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -80,24 +80,29 @@ public class ItemBase { this.twoHanded = (rs.getInt("twoHanded") == 1); - switch (ItemTemplate.itemTemplates.get(this.getUUID()).item_type) { - case RUNE: - case SCROLL: - case WAND: - case POTION: - case CHARTER: - case DEED: - case EMPLOYMENTCONTRACT: - case BUCKET: - case REALMCHARTER: - case TREASURE: - this.isConsumable = true; - break; - case OFFERING: - this.isConsumable = true; - Boon.HandleBoonListsForItemBase(uuid); - break; - } + ItemTemplate template = ItemTemplate.itemTemplates.get(this.getUUID()); + + if (template == null) + Logger.error(this.getUUID() + " null template"); + else + switch (ItemTemplate.itemTemplates.get(this.getUUID()).item_type) { + case RUNE: + case SCROLL: + case WAND: + case POTION: + case CHARTER: + case DEED: + case EMPLOYMENTCONTRACT: + case BUCKET: + case REALMCHARTER: + case TREASURE: + this.isConsumable = true; + break; + case OFFERING: + this.isConsumable = true; + Boon.HandleBoonListsForItemBase(uuid); + break; + } try { DbManager.ItemBaseQueries.LOAD_ANIMATIONS(this);