From b1b3f5042a3a4e14fdcc27f83d47492f0098321e Mon Sep 17 00:00:00 2001 From: Brianna Date: Fri, 20 Mar 2020 20:52:38 -0400 Subject: [PATCH] Added null check. --- Core/src/main/java/com/songoda/core/commands/MainCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/src/main/java/com/songoda/core/commands/MainCommand.java b/Core/src/main/java/com/songoda/core/commands/MainCommand.java index 8a98da7e..8ee39e71 100644 --- a/Core/src/main/java/com/songoda/core/commands/MainCommand.java +++ b/Core/src/main/java/com/songoda/core/commands/MainCommand.java @@ -76,6 +76,7 @@ public class MainCommand extends AbstractCommand { sender.sendMessage(ChatColor.DARK_GRAY + "- " + ChatColor.YELLOW + getSyntax() + ChatColor.GRAY + " - " + getDescription()); for (String cmdStr : commands) { final AbstractCommand cmd = nestedCommands.children.get(cmdStr); + if (cmd == null) continue; if (!isPlayer) { sender.sendMessage(ChatColor.DARK_GRAY + "- " + ChatColor.YELLOW + cmd.getSyntax() + ChatColor.GRAY + " - " + cmd.getDescription()); } else if (cmd.getPermissionNode() == null || sender.hasPermission(cmd.getPermissionNode())) {