From 5d11925813373479feeddebe149a9aab9c273990 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 25 Feb 2019 22:27:03 -0500 Subject: [PATCH] Fix NPE in help - Fixes #162 --- core/src/main/java/co/aikar/commands/CommandHelp.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/co/aikar/commands/CommandHelp.java b/core/src/main/java/co/aikar/commands/CommandHelp.java index 8cd85328..6389550f 100644 --- a/core/src/main/java/co/aikar/commands/CommandHelp.java +++ b/core/src/main/java/co/aikar/commands/CommandHelp.java @@ -60,8 +60,11 @@ public class CommandHelp { Set seen = new HashSet<>(); if (!rootCommand.getDefCommand().hasHelpCommand) { - helpEntries.add(new HelpEntry(this, rootCommand.getDefaultRegisteredCommand())); - seen.add(rootCommand.getDefaultRegisteredCommand()); + RegisteredCommand defCommand = rootCommand.getDefaultRegisteredCommand(); + if (defCommand != null) { + helpEntries.add(new HelpEntry(this, defCommand)); + seen.add(defCommand); + } } subCommands.entries().forEach(e -> {