diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-04-18 17:25:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-18 17:25:53 +0200 |
commit | f22e2beceb2d0fbcc16eff8b6271583089c5e29a (patch) | |
tree | d1844cd4c4142b65b2032e35e84b9ad813df7647 /src/main/java/at/hannibal2 | |
parent | 316738bb4324de86cfd91e981baaac3d952bb60d (diff) | |
download | skyhanni-f22e2beceb2d0fbcc16eff8b6271583089c5e29a.tar.gz skyhanni-f22e2beceb2d0fbcc16eff8b6271583089c5e29a.tar.bz2 skyhanni-f22e2beceb2d0fbcc16eff8b6271583089c5e29a.zip |
Fix: NPE in visitor reward warning (#1481)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt index 61a075bfd..e5df0c050 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorRewardWarning.kt @@ -47,13 +47,13 @@ class VisitorRewardWarning { @SubscribeEvent(priority = EventPriority.HIGH) fun onStackClick(event: GuiContainerEvent.SlotClickEvent) { if (!VisitorAPI.inInventory) return - val slot = event.slot ?: return + val stack = event.slot?.stack ?: return val visitor = VisitorAPI.getVisitor(lastClickedNpc) ?: return val blockReason = visitor.blockReason - val isRefuseSlot = slot.stack.name == "§cRefuse Offer" - val isAcceptSlot = slot.stack.name == "§aAccept Offer" + val isRefuseSlot = stack.name == "§cRefuse Offer" + val isAcceptSlot = stack.name == "§aAccept Offer" if (blockReason != null && !config.bypassKey.isKeyHeld() && ((blockReason.blockRefusing && isRefuseSlot) || !blockReason.blockRefusing && isAcceptSlot)) { @@ -66,7 +66,7 @@ class VisitorRewardWarning { return } if (isAcceptSlot) { - if (slot.stack?.name != "§eClick to give!") return + if (stack.name != "§eClick to give!") return VisitorAPI.changeStatus(visitor, VisitorAPI.VisitorStatus.ACCEPTED, "accepted") return } |