Add additional null check

This commit is contained in:
George Kalampokis 2021-11-23 11:44:50 +02:00
parent 53e298f66a
commit e8d71a8f66
1 changed files with 1 additions and 1 deletions

View File

@ -119,7 +119,7 @@ public class DmpRepository extends ElasticRepository<Dmp, DmpCriteria> {
}
searchSourceBuilder.query(boolQuery).from(criteria.getOffset()).fetchSource("id", null);
if (criteria.getSize() > 0) {
if (criteria.getSize() != null && criteria.getSize() > 0) {
searchSourceBuilder.size(criteria.getSize());
}
sortBuilders.forEach(searchSourceBuilder::sort);