From 3e05350d6b9ede5bde005f85e430d8345f8567d3 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 22 Feb 2017 12:52:43 -0800 Subject: [PATCH] Check that window is non-null before accessing constructor prop --- lib/browser/api/menu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/browser/api/menu.js b/lib/browser/api/menu.js index 14e87d3d74..28f51ca6be 100644 --- a/lib/browser/api/menu.js +++ b/lib/browser/api/menu.js @@ -147,7 +147,7 @@ Menu.prototype.popup = function (window, x, y, positioningItem) { let asyncPopup = false // menu.popup(x, y, positioningItem) - if (typeof window !== 'object' || window.constructor !== BrowserWindow) { + if (window != null && (typeof window !== 'object' || window.constructor !== BrowserWindow)) { // Shift. positioningItem = y y = x