Add parent checking before inserting or removing the child

This commit is contained in:
Phillweston
2024-05-15 12:46:17 +00:00
parent 8c5d31498b
commit a66c416fa4
12 changed files with 34 additions and 15 deletions

View File

@@ -43,7 +43,10 @@ bszCaller = {
return function (t) {
ready(function () {
try {
e(t), scriptTag && scriptTag.parentElement && scriptTag.parentElement.removeChild && scriptTag.parentElement.removeChild(scriptTag)
e(t)
if (scriptTag && scriptTag.parentElement && scriptTag.parentElement.contains(scriptTag)) {
scriptTag.parentElement.removeChild(scriptTag)
}
} catch (t) {
// console.log(t), bszTag.hides()
}