aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-08 13:08:51 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-08 13:08:51 +0200
commit3eff2e36779b6a50c3712772c81e60d0a93c6e43 (patch)
tree43b3023bf9a6a5dbf0f96443adf4a7c690f91b2d
parent4f12dd34459479a292d90110fcee5d32696129fd (diff)
downloadskyhanni-3eff2e36779b6a50c3712772c81e60d0a93c6e43.tar.gz
skyhanni-3eff2e36779b6a50c3712772c81e60d0a93c6e43.tar.bz2
skyhanni-3eff2e36779b6a50c3712772c81e60d0a93c6e43.zip
Catch and log an error in GardenVisitorFeatures
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
index f2e1c07df..15dcdba18 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt
@@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.features.garden.CropType.Companion.getByNameOrNull
import at.hannibal2.skyhanni.features.garden.GardenAPI
import at.hannibal2.skyhanni.features.garden.farming.GardenCropSpeed.getSpeed
import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper
+import at.hannibal2.skyhanni.test.command.CopyErrorCommand
import at.hannibal2.skyhanni.utils.*
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.ItemUtils.getLore
@@ -90,7 +91,16 @@ class GardenVisitorFeatures {
if (name.length == name.removeColor().length + 4) {
name = name.substring(2)
}
- val visitor = visitors[name]!!
+
+ val visitor = visitors[name]
+ if (visitor == null) {
+ println("visitors: $visitors")
+ println("name: $name")
+ println("npcItem.name: ${npcItem.name}")
+ CopyErrorCommand.logError(RuntimeException("visitor is null! '$name'"), "Error finding the visitor `$name`. Try to reopen the inventory")
+ return
+ }
+
visitor.entityId = lastClickedNpc
for (line in offerItem.getLore()) {
if (line == "ยง7Items Required:") continue