Allow settting menu to null
This commit is contained in:
parent
cc3066e746
commit
6d6e75795f
2 changed files with 3 additions and 2 deletions
|
@ -73,7 +73,7 @@ BrowserWindow::setMenu = (menu) ->
|
|||
if process.platform is 'darwin'
|
||||
throw new Error('BrowserWindow.setMenu is not available on OS X')
|
||||
|
||||
throw new TypeError('Invalid menu') unless menu?.constructor?.name is 'Menu'
|
||||
throw new TypeError('Invalid menu') unless menu is null or menu?.constructor?.name is 'Menu'
|
||||
|
||||
@menu = menu # Keep a reference of menu in case of GC.
|
||||
@menu.attachToWindow this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue