Added negative id check to Material.getMaterial(int). Fixes BUKKIT-3414

Negative id values would try to access the array out of bounds and throw an java.lang.ArrayIndexOutOfBoundsException.
This commit is contained in:
MikeMatrix
2013-01-11 02:07:38 +01:00
committed by feildmaster
parent 2877472d92
commit a91c4c6f38
2 changed files with 2 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ public class MaterialTest {
@Test
public void getByOutOfRangeId() {
assertThat(Material.getMaterial(Integer.MAX_VALUE), is(nullValue()));
assertThat(Material.getMaterial(Integer.MIN_VALUE), is(nullValue()));
}
@Test