diff lib/js/urweb.js @ 1678:d05299e561c8

Fix bug with 'dynClass' immediately inside <dyn>
author Adam Chlipala <adam@chlipala.net>
date Sat, 14 Jan 2012 11:24:17 -0500
parents 1c8456f0cf8c
children e8a84494d2c0
line wrap: on
line diff
--- a/lib/js/urweb.js	Thu Jan 12 20:37:39 2012 -0500
+++ b/lib/js/urweb.js	Sat Jan 14 11:24:17 2012 -0500
@@ -643,9 +643,10 @@
 }
 
 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);
 }