DesktopArticleTarget: only destroy notices tool if it exists

Bug: T163813
Change-Id: Ib957eac2d3d407f8e683082938ec51d882c2d041
This commit is contained in:
David Lynch 2017-04-26 10:28:49 -05:00 committed by Jforrester
parent ca512cf4a1
commit e1e89e8b14

View file

@ -802,9 +802,11 @@ ve.init.mw.DesktopArticleTarget.prototype.surfaceReady = function () {
} }
// Set edit notices, will be shown after meta dialog. // Set edit notices, will be shown after meta dialog.
// Make sure notices actually exists, because this might be a mode-switch and
// we've already removed it.
if ( editNotices.length ) { if ( editNotices.length ) {
actionTools.notices.setNotices( this.getEditNotices() ); actionTools.notices.setNotices( this.getEditNotices() );
} else { } else if ( actionTools.notices ) {
actionTools.notices.destroy(); actionTools.notices.destroy();
actionTools.notices = null; actionTools.notices = null;
} }