Throw an error if menu.popup() has no window

This commit is contained in:
Charles Kerr 2018-02-20 18:38:05 -06:00
parent 5a25b88b50
commit 9c56b81b71

View file

@ -60,9 +60,9 @@ Menu.prototype.popup = function (options) {
window = BrowserWindow.getFocusedWindow() window = BrowserWindow.getFocusedWindow()
if (!window && wins && wins.length > 0) { if (!window && wins && wins.length > 0) {
window = wins[0] window = wins[0]
if (!window) { }
throw new Error(`Cannot open Menu without a BrowserWindow present`) if (!window) {
} throw new Error(`Cannot open Menu without a BrowserWindow present`)
} }
} }