aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/js/urweb.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r--lib/js/urweb.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index ba73e744..adab5f43 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -643,9 +643,10 @@ function parent() {
}
function addNode(node) {
- if (thisScript)
- thisScript.parentNode.replaceChild(node, thisScript);
- else
+ if (thisScript) {
+ if (thisScript.parentNode)
+ thisScript.parentNode.replaceChild(node, thisScript);
+ } else
lastParent().appendChild(node);
}