mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
links: fix JS error due to a missing non-null check
Causing a console error on a COBOL code block on https://en.wikipedia.org/wiki/Visual_FoxPro. The optional chaining operator should ideally be used here, too bad it's ES2020. Bug: T376958 Change-Id: Id4c604e4897d83cb51218e785db9f553b3f32fda
This commit is contained in:
parent
7dac7163cc
commit
f455864c7b
|
@ -27,7 +27,9 @@ $( () => {
|
|||
.concat( Array.from( document.getElementsByClassName( classes.doubleQuoteString ) ) );
|
||||
|
||||
stringNodes.forEach( ( node ) => {
|
||||
if ( !node.nextElementSibling || !node.nextElementSibling.firstChild ||
|
||||
if ( !node.nextElementSibling ||
|
||||
!node.nextElementSibling.firstChild ||
|
||||
!node.nextElementSibling.firstChild.nodeValue ||
|
||||
node.nextElementSibling.firstChild.nodeValue.indexOf( ')' ) !== 0 ) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue