:art:
authorKevin Sawicki <kevinsawicki@gmail.com>
Wed, 22 Jun 2016 21:14:32 +0000 (14:14 -0700)
committerKevin Sawicki <kevinsawicki@gmail.com>
Wed, 22 Jun 2016 21:14:32 +0000 (14:14 -0700)
lib/browser/api/menu-item-roles.js

index a6a985a5e2b455dff2dd439fa9d4ba972b032605..aaebd56223b4678cfb8152bf2b4a299214232eb7 100644 (file)
@@ -125,21 +125,21 @@ exports.execute = function (role, focusedWindow) {
     return true
   }
 
-  if (focusedWindow != null) {
-    if (windowMethod) {
-      if (typeof windowMethod === 'function') {
-        windowMethod(focusedWindow)
-      } else {
-        focusedWindow[windowMethod]()
-      }
-      return true
-    } else if (webContentsMethod) {
-      const {webContents} = focusedWindow
-      if (webContents) {
-        webContents[webContentsMethod]()
-      }
-      return true
+  if (windowMethod && focusedWindow != null) {
+    if (typeof windowMethod === 'function') {
+      windowMethod(focusedWindow)
+    } else {
+      focusedWindow[windowMethod]()
     }
+    return true
+  }
+
+  if (webContentsMethod && focusedWindow != null) {
+    const {webContents} = focusedWindow
+    if (webContents) {
+      webContents[webContentsMethod]()
+    }
+    return true
   }
 
   return false