Fixed an error with null item
This commit is contained in:
parent
04271be455
commit
6170d8e77f
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user