소스 검색

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);