Browse Source

fix: showing certificate dialog with no window (#24119)

Co-authored-by: Shelley Vohr <[email protected]>
trop[bot] 4 years ago
parent
commit
c77c902cc7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/browser/api/dialog.js

+ 5 - 1
lib/browser/api/dialog.js

@@ -227,7 +227,11 @@ module.exports = {
   },
 
   showCertificateTrustDialog: function (window, options) {
-    if (window && window.constructor !== BrowserWindow) options = window;
+    if (window && window.constructor !== BrowserWindow) {
+      options = window;
+      window = null;
+    }
+
     if (options == null || typeof options !== 'object') {
       throw new TypeError('options must be an object');
     }