updated makeTOCAtLevel() to fix error "Processing error: TypeError: 'null' is not an object (evaluating 'h.localName')"
authorHook Hua <hook.hua@jpl.nasa.gov>
Mon, 29 Oct 2012 22:35:33 -0700
changeset 4581 b6fc6f0ba6dc
parent 4580 5c41683a82bb
child 4582 607e55130805
updated makeTOCAtLevel() to fix error "Processing error: TypeError: 'null' is not an object (evaluating 'h.localName')"
xml/ReSpec.js/js/respec.js
--- a/xml/ReSpec.js/js/respec.js	Mon Oct 29 20:53:32 2012 -0600
+++ b/xml/ReSpec.js/js/respec.js	Mon Oct 29 22:35:33 2012 -0700
@@ -1186,6 +1186,7 @@
                 isIntro = sn.hasClass(sec, "introductory");
             if (!sec.childNodes.length) continue;
             var h = sec.firstElementChild;
+            if (!h) continue;
             var ln = h.localName.toLowerCase();
             if (ln != "h2" && ln != "h3" && ln != "h4" && ln != "h5" && ln != "h6") continue;
             var title = h.textContent;