From 37d108006d213038a3d99af1c9487d53e31b925a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 4 Apr 2023 22:56:42 +0200 Subject: added debugs instead of throwing errors --- src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt index 733e8709f..e78457cb2 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt @@ -120,8 +120,13 @@ class CollectionAPI { // TODO add support for replenish (higher collection than actual items in inv) fun addFromInventory(internalName: String, amount: Int) { - val name = NEUItems.getItemStack(internalName).name?.removeColor() ?: return + val stack = NEUItems.getItemStackOrNull(internalName) + if (stack == null) { + LorenzUtils.debug("CollectionAPI.addFromInventory internalName '$internalName' is null!") + return + } + val name = stack.name!!.removeColor() val oldValue = collectionValue[name] ?: return val newValue = oldValue + amount -- cgit