PL-10368 NPE in FilterDelegateImpl.getDefaultFilter is possible

This commit is contained in:
Maxim Gorbunkov 2018-02-13 18:23:28 +04:00
parent 98a33f36fd
commit aaaf395498
2 changed files with 2 additions and 2 deletions

View File

@ -1076,7 +1076,7 @@ public class FilterDelegateImpl implements FilterDelegate {
}
FilterEntity globalDefaultFilter = filters.stream()
.filter(FilterEntity::getGlobalDefault)
.filter(filterEntity -> Boolean.TRUE.equals(filterEntity.getGlobalDefault()))
.findAny()
.orElse(null);
return globalDefaultFilter;

View File

@ -330,7 +330,7 @@ public class FilterEditor extends AbstractWindow {
filterEntity.setIsDefault(defaultCb.getValue());
filterEntity.setApplyDefault(applyDefaultCb.getValue());
boolean globalDefaultShouldBeChecked = !filterEntity.getGlobalDefault() && globalDefaultCb.getValue();
boolean globalDefaultShouldBeChecked = !Boolean.TRUE.equals(filterEntity.getGlobalDefault()) && globalDefaultCb.getValue();
filterEntity.setGlobalDefault(globalDefaultCb.getValue());
if (globalDefaultShouldBeChecked) {