chore: check value before use
This commit is contained in:
@@ -81,9 +81,11 @@ function insertInlineScript(dom, parentElement, selectors) {
|
|||||||
} else {
|
} else {
|
||||||
let scripts = parentElement.querySelectorAll('script:not([src]):not([no-pjax])');
|
let scripts = parentElement.querySelectorAll('script:not([src]):not([no-pjax])');
|
||||||
scripts.forEach((s) => {
|
scripts.forEach((s) => {
|
||||||
|
if (s) {
|
||||||
if (djb2(s.innerHTML) === hash) {
|
if (djb2(s.innerHTML) === hash) {
|
||||||
parentElement.removeChild(s);
|
parentElement.removeChild(s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const newScript = renewElement(script);
|
const newScript = renewElement(script);
|
||||||
|
|||||||
Reference in New Issue
Block a user