(fix)(headless) fix dfs NullPointerException when model is null. (#2212)
Some checks are pending
supersonic CentOS CI / build (21) (push) Waiting to run
supersonic mac CI / build (21) (push) Waiting to run
supersonic ubuntu CI / build (21) (push) Waiting to run
supersonic windows CI / build (21) (push) Waiting to run

This commit is contained in:
chixiaopao
2025-04-07 20:55:41 +08:00
committed by GitHub
parent b188da8595
commit 8828964e53

View File

@@ -38,7 +38,7 @@ public class ModelClusterBuilder {
}
private static ModelCluster getModelCluster(Map<Long, ModelSchemaResp> modelIdToModelSchema,
Set<Long> modelIds) {
Set<Long> modelIds) {
boolean containsPartitionDimensions = modelIds.stream().map(modelIdToModelSchema::get)
.filter(Objects::nonNull).anyMatch(modelSchemaResp -> CollectionUtils
.isNotEmpty(modelSchemaResp.getTimeDimension()));
@@ -47,7 +47,10 @@ public class ModelClusterBuilder {
}
private static void dfs(ModelSchemaResp model, Map<Long, ModelSchemaResp> modelMap,
Set<Long> visited, Set<Long> modelCluster) {
Set<Long> visited, Set<Long> modelCluster) {
if (Objects.isNull(model)) {
return;
}
visited.add(model.getId());
modelCluster.add(model.getId());
for (Long neighborId : model.getModelClusterSet()) {