From 905f168e257c0b2da72e949a5b5302fcd2302228 Mon Sep 17 00:00:00 2001 From: zml Date: Tue, 2 Sep 2014 17:15:57 -0700 Subject: [PATCH] Add a better error message for null permissions being checked --- .../tehkode/permissions/bukkit/regexperms/PermissiblePEX.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/ru/tehkode/permissions/bukkit/regexperms/PermissiblePEX.java b/src/main/java/ru/tehkode/permissions/bukkit/regexperms/PermissiblePEX.java index 92b631e4b..d4e1955da 100644 --- a/src/main/java/ru/tehkode/permissions/bukkit/regexperms/PermissiblePEX.java +++ b/src/main/java/ru/tehkode/permissions/bukkit/regexperms/PermissiblePEX.java @@ -18,6 +18,7 @@ */ package ru.tehkode.permissions.bukkit.regexperms; +import org.apache.commons.lang.Validate; import org.bukkit.entity.Player; import org.bukkit.permissions.Permissible; import org.bukkit.permissions.PermissibleBase; @@ -223,6 +224,7 @@ private PermissionCheckResult checkSingle(String expression, String permission, protected PermissionCheckResult permissionValue(String permission) { try { + Validate.notNull(permission, "Permissions being checked must not be null!"); permission = permission.toLowerCase(); PermissionCheckResult res = cache.get(permission); if (res != null) {