Skip to content

Commit 37ca3bb

Browse files
committed
refactor: 增加异常保护逻辑
1 parent b1dc225 commit 37ca3bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/BootstrapBlazor/Components/Layout/LayoutSplitebar.razor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export function init(id) {
1010
const max = parseFloat(el.getAttribute("data-bb-max") ?? "-1");
1111
const selector = el.getAttribute("data-bb-selector") ?? ".layout";
1212
const section = document.querySelector(selector);
13+
if (section === null) {
14+
log.warning(`LayoutSplitebar: selector ${selector} not found`);
15+
return;
16+
}
17+
1318
const bar = el.querySelector(".layout-splitebar-body");
1419
let originX = 0;
1520
let width = 0;

0 commit comments

Comments
 (0)