Add check to prevent ArrayIndexOutOfBoundsException in WandHelper, fixes #90 (and duplicate issues #80, #91, #97 and #98)
This commit is contained in:
@@ -107,7 +107,7 @@ public final class WandHelper {
|
|||||||
|
|
||||||
int selectedSpell = wand.getTagCompound().getInteger(SELECTED_SPELL_KEY);
|
int selectedSpell = wand.getTagCompound().getInteger(SELECTED_SPELL_KEY);
|
||||||
|
|
||||||
if(selectedSpell < spells.length){
|
if(selectedSpell >= 0 && selectedSpell < spells.length){
|
||||||
return spells[selectedSpell];
|
return spells[selectedSpell];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user