diff --git a/lib/browser/api/dialog.js b/lib/browser/api/dialog.js index 0966c81245a5..e57eb41b83ce 100644 --- a/lib/browser/api/dialog.js +++ b/lib/browser/api/dialog.js @@ -19,7 +19,7 @@ const messageBoxOptions = { } const parseArgs = function (window, options, callback, ...args) { - if (window !== null && window.constructor !== BrowserWindow) { + if (window != null && window.constructor !== BrowserWindow) { // Shift. [callback, options, window] = [options, window, null] } diff --git a/spec/api-dialog-spec.js b/spec/api-dialog-spec.js index 5d6c54083b8d..9b90b0353dc2 100644 --- a/spec/api-dialog-spec.js +++ b/spec/api-dialog-spec.js @@ -41,11 +41,11 @@ describe('dialog module', () => { describe('showMessageBox', () => { it('throws errors when the options are invalid', () => { assert.throws(() => { - dialog.showMessageBox({type: 'not-a-valid-type'}) + dialog.showMessageBox(undefined, {type: 'not-a-valid-type'}) }, /Invalid message box type/) assert.throws(() => { - dialog.showMessageBox({buttons: false}) + dialog.showMessageBox(null, {buttons: false}) }, /Buttons must be an array/) assert.throws(() => {