chore: check value before use

This commit is contained in:
Erzbir
2025-08-03 02:19:50 +08:00
parent e1c6c8213b
commit c8ac250199
+4 -2
View File
@@ -81,8 +81,10 @@ function insertInlineScript(dom, parentElement, selectors) {
} else {
let scripts = parentElement.querySelectorAll('script:not([src]):not([no-pjax])');
scripts.forEach((s) => {
if (djb2(s.innerHTML) === hash) {
parentElement.removeChild(s);
if (s) {
if (djb2(s.innerHTML) === hash) {
parentElement.removeChild(s);
}
}
});
}