Check for nullness when comparing webContents, close #1838
This commit is contained in:
parent
912ed2ca10
commit
31beee9599
1 changed files with 2 additions and 2 deletions
|
@ -88,11 +88,11 @@ BrowserWindow.getFocusedWindow = ->
|
|||
|
||||
BrowserWindow.fromWebContents = (webContents) ->
|
||||
windows = BrowserWindow.getAllWindows()
|
||||
return window for window in windows when webContents.equal window.webContents
|
||||
return window for window in windows when window.webContents?.equal webContents
|
||||
|
||||
BrowserWindow.fromDevToolsWebContents = (webContents) ->
|
||||
windows = BrowserWindow.getAllWindows()
|
||||
return window for window in windows when webContents.equal window.devToolsWebContents
|
||||
return window for window in windows when window.devToolsWebContents?.equal webContents
|
||||
|
||||
BrowserWindow.fromId = (id) ->
|
||||
BrowserWindow.windows.get id
|
||||
|
|
Loading…
Reference in a new issue