Only call getDevTools for windows that have devtools.

This commit is contained in:
Cheng Zhao 2014-04-24 12:04:23 +08:00
parent e8bf798b52
commit 822bc2fd52

View file

@ -57,7 +57,7 @@ BrowserWindow.fromProcessIdAndRoutingId = (processId, routingId) ->
BrowserWindow.fromDevTools = (processId, routingId) ->
windows = BrowserWindow.getAllWindows()
for window in windows
for window in windows when window.isDevToolsOpened()
devtools = window.getDevTools()
return window if devtools.processId == processId and
devtools.routingId == routingId