Fixed an error with null item

This commit is contained in:
libraryaddict 2020-05-06 13:07:11 +12:00
parent 04271be455
commit 6170d8e77f
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

@ -626,7 +626,7 @@ public class DisguiseParser {
disguisePerm = new DisguisePerm(disguise.getType()); disguisePerm = new DisguisePerm(disguise.getType());
name = disguise.getDisguiseName(); name = disguise.getDisguiseName();
customName = disguise.isCustomName(); customName = disguise.isCustomDisguiseName();
if (disguisePerm.isUnknown()) { if (disguisePerm.isUnknown()) {
throw new DisguiseParseException(LibsMsg.PARSE_CANT_DISG_UNKNOWN); throw new DisguiseParseException(LibsMsg.PARSE_CANT_DISG_UNKNOWN);
@ -757,11 +757,11 @@ public class DisguiseParser {
usedOptions.add(optionName); usedOptions.add(optionName);
doCheck(sender, permissions, disguisePerm, usedOptions); doCheck(sender, permissions, disguisePerm, usedOptions);
String itemName = itemStack == null ? "null" : itemStack.getType().name().toLowerCase();
if (!hasPermissionOption(disguiseOptions, optionName, if (!hasPermissionOption(disguiseOptions, optionName, itemName)) {
itemStack.getType().name().toLowerCase())) { throw new DisguiseParseException(LibsMsg.PARSE_NO_PERM_PARAM, itemName,
throw new DisguiseParseException(LibsMsg.PARSE_NO_PERM_PARAM, disguisePerm.toReadable());
itemStack.getType().name(), disguisePerm.toReadable());
} }
toSkip++; toSkip++;
@ -812,7 +812,7 @@ public class DisguiseParser {
} }
disguise.setDisguiseName(name); disguise.setDisguiseName(name);
disguise.setCustomName(customName); disguise.setCustomDisguiseName(customName);
// Copy strings to their new range // Copy strings to their new range
String[] newArgs = new String[args.length - toSkip]; String[] newArgs = new String[args.length - toSkip];