diff options
author | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-12 18:59:27 -0500 |
---|---|---|
committer | My-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com> | 2020-12-12 18:59:27 -0500 |
commit | f4e0781601e2a55bfdb6da74fbe2fe07193890c1 (patch) | |
tree | 0928ae71c7e71ca0d10b839fc88087dd169df197 | |
parent | d2b60152ae3a0a4e63732e231e49373f29cce1f9 (diff) | |
download | SkyblockMod-f4e0781601e2a55bfdb6da74fbe2fe07193890c1.tar.gz SkyblockMod-f4e0781601e2a55bfdb6da74fbe2fe07193890c1.tar.bz2 SkyblockMod-f4e0781601e2a55bfdb6da74fbe2fe07193890c1.zip |
Fix NullPointerException
-rw-r--r-- | src/main/java/me/Danker/DankersSkyblockMod.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/me/Danker/DankersSkyblockMod.java b/src/main/java/me/Danker/DankersSkyblockMod.java index 98a97af..ad5106f 100644 --- a/src/main/java/me/Danker/DankersSkyblockMod.java +++ b/src/main/java/me/Danker/DankersSkyblockMod.java @@ -3062,22 +3062,22 @@ public class DankersSkyblockMod if(slotIndex % 9 != 0 && slotIndex != 53) { ItemStack itemStack = inventory.getStackInSlot(slotIndex + 1); - if(itemStack.getItemDamage() == 5) isValid = true; + if(itemStack != null && itemStack.getItemDamage() == 5) isValid = true; } if(!isValid && slotIndex % 9 != 8 && slotIndex != 0) { ItemStack itemStack = inventory.getStackInSlot(slotIndex - 1); - if(itemStack.getItemDamage() == 5) isValid = true; + if(itemStack != null && itemStack.getItemDamage() == 5) isValid = true; } if(!isValid && slotIndex <= 44) { ItemStack itemStack = inventory.getStackInSlot(slotIndex + 9); - if(itemStack.getItemDamage() == 5) isValid = true; + if(itemStack != null && itemStack.getItemDamage() == 5) isValid = true; } if(!isValid && slotIndex >= 9) { ItemStack itemStack = inventory.getStackInSlot(slotIndex - 9); - if(itemStack.getItemDamage() == 5) isValid = true; + if(itemStack != null && itemStack.getItemDamage() == 5) isValid = true; } shouldCancel = !isValid; |