Catch a null case.

This commit is contained in:
asofold 2014-09-05 01:21:45 +02:00
parent e861b97538
commit b4669e2a53

View File

@ -142,8 +142,12 @@ public class PermissionUtil {
}
// Create change history entry.
if (cmdHadPerm) {
// TODO: Find (local?) cause of NullPointerException...
changed.add(new CommandProtectionEntry(command, lcLabel, cmdPermName, cmdPerm.getDefault(), command.getPermissionMessage()));
if (cmdPerm == null) {
changed.add(new CommandProtectionEntry(command, lcLabel, cmdPermName, null, command.getPermissionMessage()));
}
else {
changed.add(new CommandProtectionEntry(command, lcLabel, cmdPermName, cmdPerm.getDefault(), command.getPermissionMessage()));
}
}
else {
changed.add(new CommandProtectionEntry(command, lcLabel, null, null, command.getPermissionMessage()));