Browse Source

fix: 地图数据根据上级获取下级列表时,检查geo格式

hong.yang 1 year ago
parent
commit
8a46532aba

+ 3 - 0
DataRoom/dataroom-core/src/main/java/com/gccloud/dataroom/core/module/map/service/impl/DataRoomMapServiceImpl.java

@@ -385,6 +385,9 @@ public class DataRoomMapServiceImpl extends ServiceImpl<DataRoomMapDao, DataRoom
             return Lists.newArrayList();
         }
         JSONObject geoObj = JSON.parseObject(geoJson);
+        if (!geoObj.has("features")) {
+            throw new GlobalException("geoJson格式错误,缺少features");
+        }
         JSONArray features = geoObj.getJSONArray("features");
         if (features == null || features.length() == 0) {
             return Lists.newArrayList();