From ac78be7efce4e7ed2a5cf9bc4471aba3999b16c5 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 30 Nov 2020 23:27:29 +0100 Subject: [PATCH] Filter null suggestions for tab completion (avoid potential NPE) --- .../java/fr/pandacube/util/commands/SuggestionsSupplier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/fr/pandacube/util/commands/SuggestionsSupplier.java b/src/main/java/fr/pandacube/util/commands/SuggestionsSupplier.java index 8ff66e0..1cf7846 100644 --- a/src/main/java/fr/pandacube/util/commands/SuggestionsSupplier.java +++ b/src/main/java/fr/pandacube/util/commands/SuggestionsSupplier.java @@ -29,7 +29,7 @@ public interface SuggestionsSupplier { public static Predicate filter(String token) { - return suggestion -> suggestion.toLowerCase().startsWith(token.toLowerCase()); + return suggestion -> suggestion != null && suggestion.toLowerCase().startsWith(token.toLowerCase()); } /**