Skip to content

Commit 2473a62

Browse files
committed
refactor: 增加空兼容
1 parent 1ed5f73 commit 2473a62

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/BootstrapBlazor/Components/Table/Table.razor.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,13 @@ export function saveColumnList(tableName, columns) {
2929
export function reloadColumnList(tableName) {
3030
const key = `bb-table-column-visiable-${tableName}`
3131
const json = localStorage.getItem(key);
32-
3332
let columns = [];
34-
try {
35-
columns = JSON.parse(json);
33+
if (json) {
34+
try {
35+
columns = JSON.parse(json);
36+
}
37+
catch { }
3638
}
37-
catch { }
3839
return columns;
3940
}
4041

0 commit comments

Comments
 (0)