From 822bc2fd52103a62761c4065350b78b21fbf120c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 24 Apr 2014 12:04:23 +0800 Subject: [PATCH] Only call getDevTools for windows that have devtools. --- atom/browser/api/lib/browser-window.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/browser/api/lib/browser-window.coffee b/atom/browser/api/lib/browser-window.coffee index 94ca508b3959..18dacbf2e6e7 100644 --- a/atom/browser/api/lib/browser-window.coffee +++ b/atom/browser/api/lib/browser-window.coffee @@ -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