Filter null suggestions for tab completion (avoid potential NPE)

This commit is contained in:
2020-11-30 23:27:29 +01:00
parent 0a88c2d55f
commit ac78be7efc

View File

@@ -29,7 +29,7 @@ public interface SuggestionsSupplier<S> {
public static Predicate<String> filter(String token) {
return suggestion -> suggestion.toLowerCase().startsWith(token.toLowerCase());
return suggestion -> suggestion != null && suggestion.toLowerCase().startsWith(token.toLowerCase());
}
/**