From a7e6b2892c14c489a43d22789590ddccfa2a05dc Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Fri, 4 Jan 2019 20:07:02 +0000 Subject: [PATCH] Add check to prevent ArrayIndexOutOfBoundsException in WandHelper, fixes #90 (and duplicate issues #80, #91, #97 and #98) --- src/main/java/electroblob/wizardry/util/WandHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/electroblob/wizardry/util/WandHelper.java b/src/main/java/electroblob/wizardry/util/WandHelper.java index d21aa8ac..efb40332 100644 --- a/src/main/java/electroblob/wizardry/util/WandHelper.java +++ b/src/main/java/electroblob/wizardry/util/WandHelper.java @@ -107,7 +107,7 @@ public final class WandHelper { int selectedSpell = wand.getTagCompound().getInteger(SELECTED_SPELL_KEY); - if(selectedSpell < spells.length){ + if(selectedSpell >= 0 && selectedSpell < spells.length){ return spells[selectedSpell]; } }