feat:(HOTFIX) 处理项目没有服务包对应的产品的情况

This commit is contained in:
lilong 2024-09-06 11:28:51 +08:00
parent 2c90e32499
commit efbb4dd26f

View File

@ -240,9 +240,11 @@ public class WorkspaceProductServiceImpl implements WorkspaceProductService {
List<WorkspaceProductDTO> workspaceProductDTOS = Lists.newArrayList();
servicePkgDetailRes.forEach(e -> {
Set<Long> workpsaceProductIds = e.getProducts().stream()
.map(ServicePkgProduct::getProductId)
.collect(Collectors.toSet());
Set<Long> workpsaceProductIds = Optional.ofNullable(e.getProducts())
.map(products -> products.stream()
.map(ServicePkgProduct::getProductId)
.collect(Collectors.toSet()))
.orElse(null);
if (CollectionUtils.isEmpty(workpsaceProductIds)) {
return;
}