DLynch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350432 )

Change subject: DesktopArticleTarget: only destroy notices tool if it exists
......................................................................

DesktopArticleTarget: only destroy notices tool if it exists

Bug: T163813
Change-Id: Ib957eac2d3d407f8e683082938ec51d882c2d041
---
M modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
1 file changed, 10 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/32/350432/1

diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
index d0bcc36..264d786 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js
@@ -801,12 +801,16 @@
                this.setFakeRedirectInterface( null );
        }
 
-       // Set edit notices, will be shown after meta dialog.
-       if ( editNotices.length ) {
-               actionTools.notices.setNotices( this.getEditNotices() );
-       } else {
-               actionTools.notices.destroy();
-               actionTools.notices = null;
+       if ( actionTools.notices ) {
+               // 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 ) {
+                       actionTools.notices.setNotices( this.getEditNotices() );
+               } else {
+                       actionTools.notices.destroy();
+                       actionTools.notices = null;
+               }
        }
 
        this.setupUnloadHandlers();

-- 
To view, visit https://gerrit.wikimedia.org/r/350432
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib957eac2d3d407f8e683082938ec51d882c2d041
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to