Skip to content

Commit 7a8bff0

Browse files
fixed bug with commands without descriptions
1 parent b1c6f9b commit 7a8bff0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/datasiqn/commandcore/CommandCore.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ public void sendHelpMenu(@NotNull CommandSender sender) {
8787
sender.sendMessage(ChatColor.GOLD + (options.hasCustomPluginName() ? options.getPluginName() : plugin.getName()) + " Commands");
8888
commandManager.getCommandNames(false).stream().sorted().forEach(name -> {
8989
Command command = commandManager.getCommand(name, false);
90-
if (!command.hasPermission() || sender.hasPermission(command.getPermissionString())) sender.sendMessage(ChatColor.YELLOW + " " + name, ChatColor.GRAY + " ↳ " + command.getDescription());
90+
if (!command.hasPermission() || sender.hasPermission(command.getPermissionString())) {
91+
String description = command.hasDescription() ? command.getDescription() : "No description provided";
92+
sender.sendMessage(ChatColor.YELLOW + " " + name, ChatColor.GRAY + " ↳ " + description);
93+
}
9194
});
9295
}
9396

0 commit comments

Comments
 (0)