aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThunderblade73 <85900443+Thunderblade73@users.noreply.github.com>2024-02-14 19:39:44 +0100
committerGitHub <noreply@github.com>2024-02-14 19:39:44 +0100
commitb015efd63855b3458aa0133f537efbcfedbe32f8 (patch)
tree4ddec2241b611abba6f4ecfcb9a58b829e581a9f
parent9a62214a6aad473d1ae070ebd63a2a20b3488d6f (diff)
downloadskyhanni-b015efd63855b3458aa0133f537efbcfedbe32f8.tar.gz
skyhanni-b015efd63855b3458aa0133f537efbcfedbe32f8.tar.bz2
skyhanni-b015efd63855b3458aa0133f537efbcfedbe32f8.zip
Fixed an error when trying to use the shift click feature in empty NPC sell inventory. #996
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt5
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