Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

fix: 打开数据透视图后,没有配置行列,直接切换其他Sheet,导致空指针异常 #1425

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/controllers/sheetmanage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1487,26 +1487,29 @@ const sheetmanage = {
let data = d;

let addr = 0, addc = 0;
let rlen = ret.length,
clen = ret[0].length;
let rlen = ret.length;
let clen = 0;
if (rlen > 0) {
clen = ret[0].length;
}

addr = rlen - d.length;
addc = clen - d[0].length;
addr = rlen - d.length;
addc = clen - d[0].length;

data = datagridgrowth(d, addr + 20, addc + 10, true);
data = datagridgrowth(d, addr + 20, addc + 10, true);

for (let r = 0; r < rlen; r++) {
// let x = [].concat(data[r]);
for (let c = 0; c < clen; c++) {
let value = "";
if (ret[r] != null && ret[r][c] != null) {
value = getcellvalue(r, c, ret);
setcellvalue(r,c,data,value)
}
// x[c] = value;
for (let r = 0; r < rlen; r++) {
// let x = [].concat(data[r]);
for (let c = 0; c < clen; c++) {
let value = "";
if (ret[r] != null && ret[r][c] != null) {
value = getcellvalue(r, c, ret);
setcellvalue(r,c,data,value)
}
// data[r] = x;
// x[c] = value;
}
// data[r] = x;
}
file.data = data;
},
checkLoadSheetIndexToDataIndex: {},
Expand Down