simple-ui: fix NPE on filters (#2635)
* simple-ui: fix NPE on filters * simple-ui: fix NPE on filters
This commit is contained in:
@@ -116,13 +116,7 @@ public class Filter extends Div {
|
||||
final Map<Object, Object> normalized = new HashMap<>(keyToValues)
|
||||
.entrySet()
|
||||
.stream()
|
||||
.map(e -> {
|
||||
if (e.getValue() instanceof Optional<?> opt) {
|
||||
e.setValue(opt.orElse(null));
|
||||
}
|
||||
return e;
|
||||
})
|
||||
.filter(e -> !ObjectUtils.isEmpty(e))
|
||||
.filter(e -> !ObjectUtils.isEmpty(e.getValue()))
|
||||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||
if (normalized.isEmpty()) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user