Fixes bug on public Dataset criteria not checking for empty array of dmpIds.

This commit is contained in:
gkolokythas 2019-06-10 17:02:38 +03:00
parent 00661483ab
commit 7b4a809f3d
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ public class DatasetPublicTableRequest extends TableQuery<DatasetPublicCriteria,
builder.or(builder.greaterThan(root.get("dmp").get("project").get("enddate"), new Date())
, builder.isNull(root.get("dmp").get("project").get("enddate"))));
}
if (this.getCriteria().getDmpIds() != null) {
if (this.getCriteria().getDmpIds() != null && !this.getCriteria().getDmpIds().isEmpty()) {
query.where(((builder, root) -> root.get("dmp").get("id").in(this.getCriteria().getDmpIds())));
}
if (this.getCriteria().getDatasetProfile() != null && !this.getCriteria().getDatasetProfile().isEmpty()) query