From d27af3dd09a882fce4f1e2774065de57a3501858 Mon Sep 17 00:00:00 2001 From: Koy Zhuang Date: Wed, 26 Oct 2022 16:58:49 +0800 Subject: [PATCH] fix: filter null node first. (#1909) --- src/core/render/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/render/index.js b/src/core/render/index.js index cfd790441..9b40939ed 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -260,7 +260,9 @@ export function Render(Base) { [ document.querySelector('aside.sidebar'), document.querySelector('button.sidebar-toggle'), - ].forEach(node => node.parentNode.removeChild(node)); + ] + .filter(e => !!e) + .forEach(node => node.parentNode.removeChild(node)); document.querySelector('section.content').style.right = 'unset'; document.querySelector('section.content').style.left = 'unset'; document.querySelector('section.content').style.position = 'relative';