Skip to content

Commit 5b8a1d7

Browse files
committed
Return null when no public kit IDs for tab completion
- Store public kit IDs before returning tab-complete results - Return `null` instead of an empty list when no public kits exist
1 parent 97f116b commit 5b8a1d7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/dev/noah/perplayerkit/commands/admin/SavePublicKitCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command
9393
@Override
9494
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
9595
if (args.length == 1) {
96-
return KitManager.get().getPublicKitList().stream().map(kit -> kit.id).toList();
96+
List<String> ids = KitManager.get().getPublicKitList().stream().map(kit -> kit.id).toList();
97+
return ids.isEmpty() ? null : ids;
9798
}
9899

99100
return null;

0 commit comments

Comments
 (0)