Trevor Parscal has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/146907

Change subject: Safely ignore requests to open unrecognized windows
......................................................................

Safely ignore requests to open unrecognized windows

Change-Id: I892f7ff43a7fd7c78be071986ccf3a7119dd1ace
---
M modules/ve/ui/actions/ve.ui.WindowAction.js
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/07/146907/1

diff --git a/modules/ve/ui/actions/ve.ui.WindowAction.js 
b/modules/ve/ui/actions/ve.ui.WindowAction.js
index 52ba352..82d09d9 100644
--- a/modules/ve/ui/actions/ve.ui.WindowAction.js
+++ b/modules/ve/ui/actions/ve.ui.WindowAction.js
@@ -53,12 +53,14 @@
 
        data = ve.extendObject( { 'dir': dir }, data, { 'fragment': fragment } 
);
 
-       if ( windowClass.prototype instanceof ve.ui.FragmentInspector ) {
-               windowManager = this.surface.getContext().getInspectors();
-       } else if ( windowClass.prototype instanceof OO.ui.Dialog ) {
-               windowManager = this.surface.getDialogs();
+       if ( windowClass ) {
+               if ( windowClass.prototype instanceof ve.ui.FragmentInspector ) 
{
+                       windowManager = 
this.surface.getContext().getInspectors();
+               } else if ( windowClass.prototype instanceof OO.ui.Dialog ) {
+                       windowManager = this.surface.getDialogs();
+               }
+               windowManager.openWindow( name, data );
        }
-       windowManager.openWindow( name, data );
 };
 
 /* Registration */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I892f7ff43a7fd7c78be071986ccf3a7119dd1ace
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Trevor Parscal <[email protected]>

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

Reply via email to