mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
DesktopArticleTarget: Prevent infinite while loop if $content is empty
Change-Id: I629b2c3f1a4af3441764db7d1d0a7cec96181396
This commit is contained in:
parent
09829ae7b4
commit
889ffc0efc
|
@ -1258,7 +1258,7 @@ ve.init.mw.DesktopArticleTarget.prototype.transformPage = function () {
|
|||
|
||||
// Mark every non-direct ancestor between editableContent and the container as uneditable
|
||||
$content = this.$editableContent;
|
||||
while ( $content && !$content.parent().is( this.$container ) ) {
|
||||
while ( $content && $content.length && !$content.parent().is( this.$container ) ) {
|
||||
$content.prevAll().addClass( 've-init-mw-desktopArticleTarget-uneditableContent' );
|
||||
$content.nextAll().addClass( 've-init-mw-desktopArticleTarget-uneditableContent' );
|
||||
$content = $content.parent();
|
||||
|
|
Loading…
Reference in a new issue