Fix NPE when using flag command.

This commit is contained in:
bloodshot 2019-12-30 18:50:20 -05:00
parent 436f053fbe
commit dde267d997
4 changed files with 8 additions and 4 deletions

View File

@ -160,7 +160,8 @@ public void execute(Player player, String[] args) throws InvalidCommandArgument
}
}
final Set<Context> contextSet = CauseContextHelper.generateContexts(flag.getPermission(), player, claim, contexts);
String flagPermission = flag != null ? flag.getPermission() : "";
final Set<Context> contextSet = CauseContextHelper.generateContexts(flagPermission, player, claim, contexts);
if (contextSet == null) {
return;
}

View File

@ -181,7 +181,8 @@ public void execute(Player player, String[] args) throws InvalidCommandArgument
}
}
final Set<Context> contextSet = CauseContextHelper.generateContexts(option.getPermission(), player, claim, contexts);
String optionPermission = option != null ? option.getPermission() : "";
final Set<Context> contextSet = CauseContextHelper.generateContexts(optionPermission, player, claim, contexts);
if (contextSet == null) {
return;
}

View File

@ -160,7 +160,8 @@ public void execute(Player player, String[] args) throws InvalidCommandArgument
}
}
final Set<Context> contextSet = CauseContextHelper.generateContexts(flag.getPermission(), player, claim, contexts);
String flagPermission = flag != null ? flag.getPermission() : "";
final Set<Context> contextSet = CauseContextHelper.generateContexts(flagPermission, player, claim, contexts);
if (contextSet == null) {
return;
}

View File

@ -181,7 +181,8 @@ public void execute(Player player, String[] args) throws InvalidCommandArgument
}
}
final Set<Context> contextSet = CauseContextHelper.generateContexts(option.getPermission(), player, claim, contexts);
String optionPermission = option != null ? option.getPermission() : "";
final Set<Context> contextSet = CauseContextHelper.generateContexts(optionPermission, player, claim, contexts);
if (contextSet == null) {
return;
}