mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 18:39:42 -05:00
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. By: MikeMatrix <m.braun92@gmail.com>
This commit is contained in:
1 parent
de7c26870b
commit
08fa8ed053
2 files changed
+2
-1
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user