diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 067b546b9..0d54d7251 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5180,7 +5180,6 @@ function Ace2Inner(){ { if(n > lineNumbersShown) //all updated, break break; - var h = (b.clientHeight || b.offsetHeight); if (b.nextSibling) { @@ -5215,17 +5214,23 @@ function Ace2Inner(){ var n = lineNumbersShown; var div = odoc.createElement("DIV"); //calculate height for new line number - var h = (b.clientHeight || b.offsetHeight); + if(b){ + var h = (b.clientHeight || b.offsetHeight); - if (b.nextSibling) - h = b.nextSibling.offsetTop - b.offsetTop; + if (b.nextSibling){ + h = b.nextSibling.offsetTop - b.offsetTop; + } + } - if(h) // apply style to div + if(h){ // apply style to div div.style.height = h +"px"; - + } + div.appendChild(odoc.createTextNode(String(n))); fragment.appendChild(div); - b = b.nextSibling; + if(b){ + b = b.nextSibling; + } } container.appendChild(fragment);