Check for nullness when comparing webContents, close #1838

This commit is contained in:
Cheng Zhao 2015-06-03 18:48:10 +08:00
parent 912ed2ca10
commit 31beee9599

View file

@ -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