From e011bfe9cab9d5f23b52de6bfe7eaa6d26dba138 Mon Sep 17 00:00:00 2001 From: Reflxction Dev Date: Wed, 27 Apr 2022 20:18:48 +0300 Subject: [PATCH] Fix null help entries being added to the generated help --- .../main/java/revxrsal/commands/core/BaseCommandHelp.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/revxrsal/commands/core/BaseCommandHelp.java b/common/src/main/java/revxrsal/commands/core/BaseCommandHelp.java index ac9fa64d..df95335d 100644 --- a/common/src/main/java/revxrsal/commands/core/BaseCommandHelp.java +++ b/common/src/main/java/revxrsal/commands/core/BaseCommandHelp.java @@ -51,8 +51,10 @@ public Resolver(BaseCommandHandler handler) { CommandPath parentPath = parent == null ? null : parent.getPath(); handler.executables.values().stream().sorted().forEach(c -> { if (parentPath == null || parentPath.isParentOf(c.getPath())) { - if (c != helpCommand) - entries.add(writer.generate(c, context.actor())); + if (c != helpCommand) { + Object generated = writer.generate(c, context.actor()); + if (generated != null) entries.add(generated); + } } }); return entries;