Throw an error if menu.popup() has no window
This commit is contained in:
parent
5a25b88b50
commit
9c56b81b71
1 changed files with 3 additions and 3 deletions
|
@ -60,11 +60,11 @@ 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) {
|
if (!window) {
|
||||||
throw new Error(`Cannot open Menu without a BrowserWindow present`)
|
throw new Error(`Cannot open Menu without a BrowserWindow present`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.popupAt(window, x, y, positioningItem, callback)
|
this.popupAt(window, x, y, positioningItem, callback)
|
||||||
return { browserWindow: window, x, y, position: positioningItem }
|
return { browserWindow: window, x, y, position: positioningItem }
|
||||||
|
|
Loading…
Add table
Reference in a new issue