fix(视图): 修复指标卡空指针异常

This commit is contained in:
jianneng-fit2cloud 2024-09-25 21:46:20 +08:00
parent ff6d69e095
commit 03f7955d28

View File

@ -787,6 +787,9 @@ public class ChartViewService {
return emptyChartViewDTO(view);
}
ChartFieldCompareDTO compareCalc = yAxis.get(0).getCompareCalc();
if (Objects.isNull(compareCalc)) {
break;
}
boolean isYoy = StringUtils.isNotEmpty(compareCalc.getType()) && !StringUtils.equalsIgnoreCase(compareCalc.getType(), "none");
if (isYoy) {
List<DatasetTableField> xField = fields.stream().filter(item -> StringUtils.equalsIgnoreCase(item.getId(), compareCalc.getField())).collect(Collectors.toList());