diff --git a/core/core-backend/src/main/java/io/dataease/visualization/manage/VisualizationTemplateExtendDataManage.java b/core/core-backend/src/main/java/io/dataease/visualization/manage/VisualizationTemplateExtendDataManage.java index 3435aacdde..498fead9c9 100644 --- a/core/core-backend/src/main/java/io/dataease/visualization/manage/VisualizationTemplateExtendDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/visualization/manage/VisualizationTemplateExtendDataManage.java @@ -6,6 +6,7 @@ import io.dataease.exception.DEException; import io.dataease.template.dao.auto.entity.VisualizationTemplateExtendData; import io.dataease.template.dao.auto.mapper.VisualizationTemplateExtendDataMapper; import io.dataease.utils.JsonUtil; +import io.dataease.utils.LogUtil; import jakarta.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; @@ -28,8 +29,15 @@ public class VisualizationTemplateExtendDataManage { queryWrapper.eq("view_id",viewId); List extendDataList = extendDataMapper.selectList(queryWrapper); if (CollectionUtils.isNotEmpty(extendDataList)) { - ChartViewDTO chartViewTemplate = JsonUtil.parseObject(extendDataList.get(0).getViewDetails(),ChartViewDTO.class); - view.setData(chartViewTemplate.getData()); + try{ + ChartViewDTO chartViewTemplate = JsonUtil.parseObject(extendDataList.get(0).getViewDetails(),ChartViewDTO.class); + if(chartViewTemplate != null){ + view.setData(chartViewTemplate.getData()); + } + }catch (Exception e){ + LogUtil.error("未获取内置数据:"+viewId); + } + } else { DEException.throwException("模板缓存数据中未获取指定图表数据:" + viewId); }