Skip to content

Commit

Permalink
Fix NPE when given invalid material ids
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Aug 9, 2018
1 parent 02ce140 commit a81a659
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -511,6 +511,9 @@ public static Material getMaterial(String type, int data) {
}

public static Material getMaterial(Material legacymat, int data) {
if(legacymat == null) {
return null;
}
if(legacymat.getMaxDurability() == 0) {
return Bukkit.getUnsafe().fromLegacy(new MaterialData(legacymat, (byte) data));
} else {
Expand Down

0 comments on commit a81a659

Please sign in to comment.