Filter null suggestions for tab completion (avoid potential NPE)

This commit is contained in:
Marc Baloup 2020-11-30 23:27:29 +01:00
parent 0a88c2d55f
commit ac78be7efc
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893

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());
}
/**