aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
index 5182c5c54..e3f06b83b 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/InventoryUtils.kt
@@ -79,7 +79,8 @@ object InventoryUtils {
fun isSlotInPlayerInventory(itemStack: ItemStack): Boolean {
val screen = Minecraft.getMinecraft().currentScreen as? GuiContainer ?: return false
- return screen.slotUnderMouse.inventory is InventoryPlayer && screen.slotUnderMouse.stack == itemStack
+ val slotUnderMouse = screen.slotUnderMouse ?: return false
+ return slotUnderMouse.inventory is InventoryPlayer && slotUnderMouse.stack == itemStack
}
fun isItemInInventory(name: NEUInternalName) = name.getAmountInInventory() > 0