From acfd192a56cf0768e7ea7daed83864e578380436 Mon Sep 17 00:00:00 2001 From: RayzsYT <51991564+RayzsYT@users.noreply.github.com> Date: Tue, 18 Jun 2024 18:18:40 +0200 Subject: [PATCH] Fix Exception --- .../pat/api/storage/storages/BlacklistStorage.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/rayzs/pat/api/storage/storages/BlacklistStorage.java b/src/main/java/de/rayzs/pat/api/storage/storages/BlacklistStorage.java index 1120a82e..37203f50 100644 --- a/src/main/java/de/rayzs/pat/api/storage/storages/BlacklistStorage.java +++ b/src/main/java/de/rayzs/pat/api/storage/storages/BlacklistStorage.java @@ -1,6 +1,7 @@ package de.rayzs.pat.api.storage.storages; import de.rayzs.pat.api.storage.*; +import de.rayzs.pat.plugin.logger.Logger; import de.rayzs.pat.utils.StringUtils; import de.rayzs.pat.utils.permission.PermissionUtil; @@ -50,10 +51,17 @@ public class BlacklistStorage extends StorageTemplate implements Serializable { } public boolean isListed(String command, boolean intensive) { + if(commands == null) { + Logger.warning("&cFailed to check command \"" + command + "\"! PAT couldn't read the commands from the storage.yml at section &4" + getNavigatePath() + "&c! Please ensure that your storage.yml isn't corrupt or contains any spaces or empty commands. If this problem still remains, please join my Discord server to ask for help there. &8(&erayzs.de/discord&8)"); + return false; + } + if(!isConverted(command, intensive)) command = convertCommand(command, intensive, true); - for (String commands : commands) - if(commands.equals(command)) return true; + for (String commands : commands) { + if(commands == null) continue; + if (commands.equals(command)) return true; + } return false; }