simple-ui: fix NPE on filters (#2635)

* simple-ui: fix NPE on filters

* simple-ui: fix NPE on filters
This commit is contained in:
Mohamed Zenadi
2025-09-09 14:03:05 +02:00
committed by GitHub
parent dd5f12d8c5
commit f2e6344775

View File

@@ -116,13 +116,7 @@ public class Filter extends Div {
final Map<Object, Object> normalized = new HashMap<>(keyToValues) final Map<Object, Object> normalized = new HashMap<>(keyToValues)
.entrySet() .entrySet()
.stream() .stream()
.map(e -> { .filter(e -> !ObjectUtils.isEmpty(e.getValue()))
if (e.getValue() instanceof Optional<?> opt) {
e.setValue(opt.orElse(null));
}
return e;
})
.filter(e -> !ObjectUtils.isEmpty(e))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
if (normalized.isEmpty()) { if (normalized.isEmpty()) {
return null; return null;