aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt9
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt14
3 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt
index 08234bdf1..0b6178399 100644
--- a/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt
+++ b/src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt
@@ -18,7 +18,6 @@ abstract class LorenzEvent : Event() {
if (it is NoSuchMethodError) {
LorenzUtils.chat("§c[SkyHanni] You need to use a newer version of NotEnoughUpdates (alpha-11 or newer)! If you need help downloading it, go to the skyhanni discord.")
} else {
- it.printStackTrace()
CopyErrorCommand.logError(it, "Caught an ${it::class.simpleName ?: "error"} at ${eventName}: '${it.message}'")
}
}.getOrDefault(isCanceled)
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt
index 5e2321e24..e6f646ef1 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataHolder.kt
@@ -48,8 +48,13 @@ class BazaarDataHolder {
fun getData(internalName: String) = bazaarData[internalName] ?: createNewData(internalName)
- private fun createNewData(internalName: String): BazaarData {
- val displayName = NEUItems.getItemStack(internalName).name!!.removeColor()
+ private fun createNewData(internalName: String): BazaarData? {
+ val stack = NEUItems.getItemStackOrNull(internalName)
+ if (stack == null) {
+ LorenzUtils.debug("Bazaar data is null: '$internalName'")
+ return null
+ }
+ val displayName = stack.name!!.removeColor()
val sellPrice = NEUItems.getPrice(internalName, true)
val buyPrice = NEUItems.getPrice(internalName, false)
val npcPrice = npcPrices[internalName].let {
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())