diff --git a/src/main/java/world/bentobox/bentobox/api/user/User.java b/src/main/java/world/bentobox/bentobox/api/user/User.java index 0c4c5e928..ccd75f32f 100644 --- a/src/main/java/world/bentobox/bentobox/api/user/User.java +++ b/src/main/java/world/bentobox/bentobox/api/user/User.java @@ -223,6 +223,7 @@ public class User { return offlinePlayer != null; } + @Nullable public CommandSender getSender() { return sender; } @@ -233,10 +234,10 @@ public class User { /** * @param permission permission string - * @return true if permission is empty or if the player has that permission or if the player is op. + * @return true if permission is empty or null or if the player has that permission or if the player is op. */ - public boolean hasPermission(String permission) { - return permission.isEmpty() || isOp() || sender.hasPermission(permission); + public boolean hasPermission(@Nullable String permission) { + return permission == null || permission.isEmpty() || isOp() || sender.hasPermission(permission); } /**