Fixed NPE when player does not have an item in his hand

This commit is contained in:
Eric 2017-06-05 13:31:47 +02:00
parent 48eda92079
commit 9f229bbf6a

View File

@ -270,6 +270,7 @@ public class Utils {
return true;
}
if (item != null) {
if (item.getDurability() == 0) {
if (player.hasPermission(Permissions.CREATE + "." + item.getType().toString())) {
return true;
@ -279,6 +280,7 @@ public class Utils {
if (player.hasPermission(Permissions.CREATE + "." + item.getType().toString() + "." + item.getDurability())) {
return true;
}
}
return false;
}