Fixed issue if dataset has no profile
This commit is contained in:
parent
dc83a3a09c
commit
4b30d56d91
|
@ -188,7 +188,7 @@ public class DatasetManager {
|
|||
DataTableData<DatasetListingModel> dataTable = new DataTableData<>();
|
||||
|
||||
|
||||
dataTable.setData(pagedItems.select(this::mapModel));
|
||||
dataTable.setData(pagedItems.select(this::mapModel).stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||
|
||||
dataTable.setTotalCount(authItems.count());
|
||||
|
||||
|
@ -239,7 +239,7 @@ public class DatasetManager {
|
|||
|
||||
CompletableFuture<List<DatasetListingModel>> itemsFuture = pagedItems.
|
||||
selectAsync(this::mapModel).whenComplete((resultList, throwable) -> {
|
||||
dataTable.setData(resultList);
|
||||
dataTable.setData(resultList.stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||
});
|
||||
|
||||
CompletableFuture countFuture = pagedItems.countAsync().whenComplete((count, throwable) -> {
|
||||
|
@ -1049,6 +1049,8 @@ public class DatasetManager {
|
|||
|
||||
@Transactional
|
||||
private DatasetListingModel mapModel(Dataset item) {
|
||||
if (item.getProfile() == null)
|
||||
return null;
|
||||
DatasetListingModel listingModel = new DatasetListingModel().fromDataModel(item);
|
||||
DatasetProfileCriteria criteria = new DatasetProfileCriteria();
|
||||
criteria.setGroupIds(Collections.singletonList(item.getProfile().getGroupId()));
|
||||
|
|
Loading…
Reference in New Issue