Skip to content

Commit 7cdfe55

Browse files
Line numbers: Fixed null reference (#2605)
1 parent 093c817 commit 7cdfe55

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

plugins/line-numbers/prism-line-numbers.js

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
}
3434

3535
var lineNumberRows = element.querySelector('.line-numbers-rows');
36+
if (!lineNumberRows) {
37+
return;
38+
}
3639
var lineNumberStart = parseInt(element.getAttribute('data-start'), 10) || 1;
3740
var lineNumberEnd = lineNumberStart + (lineNumberRows.children.length - 1);
3841

plugins/line-numbers/prism-line-numbers.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)