mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Throw an error if menu.popup() has no window
This commit is contained in:
@@ -60,9 +60,9 @@ Menu.prototype.popup = function (options) {
|
||||
window = BrowserWindow.getFocusedWindow()
|
||||
if (!window && wins && wins.length > 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`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user