浏览代码

fix: 数组可能为undefined

wxl 5 年之前
父节点
当前提交
7c384022dc
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/utils/coordinate.js

+ 1 - 1
src/utils/coordinate.js

@@ -302,7 +302,7 @@ class Coordinate {
     _moveUpAll(){
         let me = this;
         forEach(this.coors, (row) => {
-            forEach(row, (cell) => {
+            forEach(row || [], (cell) => {
                 if(!cell || cell.y === 0) return;
                 let canUpRows = me.getEmptyRowsBeforeLine(cell.x, cell.y, cell.w);
                 cell.fill(null);