From b4669e2a539bf3c72646b19c4f1aa7e28a15a85c Mon Sep 17 00:00:00 2001 From: asofold Date: Fri, 5 Sep 2014 01:21:45 +0200 Subject: [PATCH] Catch a null case. --- .../nocheatplus/permissions/PermissionUtil.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/permissions/PermissionUtil.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/permissions/PermissionUtil.java index 0e3ca50d..9e938425 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/permissions/PermissionUtil.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/permissions/PermissionUtil.java @@ -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()));