Skip to content

Commit 90dfee9

Browse files
committed
Fix a crash reported in #26
1 parent f651fae commit 90dfee9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

static/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,14 @@
794794
indexEnd = error.indexOf(':', index);
795795
if (indexEnd > index) {
796796
lineNum = parseInt(error.substring(index, indexEnd));
797-
index = indexEnd + 1;
798-
indexEnd = error.indexOf("ERROR: 0:", index);
799-
lineError = htmlEncode((indexEnd > index) ? error.substring(index, indexEnd) : error.substring(index));
800-
line = code.setMarker(lineNum - 1, '<abbr title="' + lineError + '">' + lineNum + '</abbr>', "errorMarker");
801-
code.setLineClass(line, "errorLine");
802-
errorLines.push(line);
797+
if ((!isNaN(lineNum)) && (lineNum > 0)) {
798+
index = indexEnd + 1;
799+
indexEnd = error.indexOf("ERROR: 0:", index);
800+
lineError = htmlEncode((indexEnd > index) ? error.substring(index, indexEnd) : error.substring(index));
801+
line = code.setMarker(lineNum - 1, '<abbr title="' + lineError + '">' + lineNum + '</abbr>', "errorMarker");
802+
code.setLineClass(line, "errorLine");
803+
errorLines.push(line);
804+
}
803805
}
804806
}
805807

0 commit comments

Comments
 (0)