From 1ff9c6ead7343eebc1f0efc980d5f29faa8f68ec Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 22 Jun 2023 16:43:20 +0200 Subject: Fixed the error message with HEMOVIBE not found in NEU Repo --- src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 07e1c9318..dc98f3a0a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -134,15 +134,11 @@ object NEUItems { .withKnownInternalName(internalName) .resolveToItemStack()?.copy() - fun getItemStack(internalName: String): ItemStack { - val stack = getItemStackOrNull(internalName) - if (stack == null) { - val error = "ItemResolutionQuery returns null for internalName '$internalName'" - LorenzUtils.error(error) - throw RuntimeException(error) - } - return stack - } + fun getItemStack(internalName: String): ItemStack = getItemStackOrNull(internalName) + ?: throw IllegalStateException( + "Could not find the Item '$internalName' in NEU Repo", + Error("ItemResolutionQuery returns null for internalName '$internalName'") + ) fun isVanillaItem(item: ItemStack) = manager.auctionManager.isVanillaItem(item.getInternalName()) -- cgit