Commit 3fa94cca authored by michael.simon's avatar michael.simon
Browse files

Check for null on filter maps

parent 6ea5a508
...@@ -192,10 +192,12 @@ public abstract class JpaBaseDao<T extends BaseEntity<PK>, PK extends Serializab ...@@ -192,10 +192,12 @@ public abstract class JpaBaseDao<T extends BaseEntity<PK>, PK extends Serializab
protected List<Predicate> predicatesFromFilterMap(CriteriaBuilder builder, Root<T> root, Map<String, Object> filterMap) { protected List<Predicate> predicatesFromFilterMap(CriteriaBuilder builder, Root<T> root, Map<String, Object> filterMap) {
List<Predicate> predicates = new ArrayList<Predicate>(filterMap.size()); List<Predicate> predicates = new ArrayList<Predicate>();
for (Entry<String, Object> entry : filterMap.entrySet()) { if (filterMap != null) {
for (Entry<String, Object> entry : filterMap.entrySet()) {
predicates.add(predicateFromObject(builder, root, entry.getKey(), entry.getValue()));
predicates.add(predicateFromObject(builder, root, entry.getKey(), entry.getValue()));
}
} }
return predicates; return predicates;
...@@ -206,9 +208,11 @@ public abstract class JpaBaseDao<T extends BaseEntity<PK>, PK extends Serializab ...@@ -206,9 +208,11 @@ public abstract class JpaBaseDao<T extends BaseEntity<PK>, PK extends Serializab
List<Predicate> predicates = new ArrayList<Predicate>(); List<Predicate> predicates = new ArrayList<Predicate>();
for (Entry<String, FilterMeta> entry : additionalFilterMap.entrySet()) { if (additionalFilterMap != null) {
if (entry.getValue() != null && entry.getValue().getFilterValue() != null) { for (Entry<String, FilterMeta> entry : additionalFilterMap.entrySet()) {
predicates.add(predicateFromFilterMeta(builder, root, entry.getKey(), entry.getValue())); if (entry.getValue() != null && entry.getValue().getFilterValue() != null) {
predicates.add(predicateFromFilterMeta(builder, root, entry.getKey(), entry.getValue()));
}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment