Add additional null check for Elastic's Dmp Repository

This commit is contained in:
George Kalampokis 2021-10-08 11:18:22 +03:00
parent 9919886c26
commit 1d48ee81b9
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
}
if (criteria.getCollaborators() != null && criteria.getCollaborators().size() > 0) {
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.COLLABORATORS.getName() + ".id.keyword", criteria.getCollaborators().stream().map(UUID::toString).collect(Collectors.toList())));
boolQuery = boolQuery.should(QueryBuilders.termsQuery(Dmp.MapKey.COLLABORATORS.getName() + ".id.keyword", criteria.getCollaborators().stream().filter(Objects::nonNull).map(UUID::toString).collect(Collectors.toList())));
}
if (!criteria.isAllowAllVersions()) {