diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt index fbdd047db..b1a95c313 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt @@ -29,9 +29,10 @@ object ShiftClickNPCSell { @SubscribeEvent fun onOpen(event: InventoryFullyOpenedEvent) { if (!LorenzUtils.inSkyBlock) return - val item = event.inventoryItems[event.inventoryItems.keys.last() + sellSlot] + if (event.inventoryItems.isEmpty()) return + val item = event.inventoryItems[event.inventoryItems.keys.last() + sellSlot] ?: return - inInventory = lastLoreLineOfSellPattern.matches(item?.getLore()?.lastOrNull()) + inInventory = lastLoreLineOfSellPattern.matches(item.getLore().lastOrNull()) } @SubscribeEvent |