瀏覽代碼

修复数据不存在导致空指针

wangming 10 月之前
父節點
當前提交
82bffae668
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      luckysheet/src/main/java/com/xc/luckysheet/db/server/JfGridUpdateService.java

+ 7 - 0
luckysheet/src/main/java/com/xc/luckysheet/db/server/JfGridUpdateService.java

@@ -943,6 +943,13 @@ public class JfGridUpdateService {
             if (_celldatas != null) {
                 for (int x = _celldatas.size() - 1; x >= 0; x--) {
                     JSONObject _cell = _celldatas.getJSONObject(x);
+
+                    //删除无横纵坐标的对象
+                    if(_cell.get("r") == null || _cell.get("c") == null) {
+                        _celldatas.remove(x);
+                        continue;
+                    }
+
                     Integer _r = Integer.parseInt(_cell.get("r").toString());
                     Integer _c = Integer.parseInt(_cell.get("c").toString());
                     //判断是否删除