From eaa567dd8663cd125e2973be35bd94d8e4c658c8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 2 Aug 2016 16:14:42 -0700 Subject: [PATCH] Ignore windows with no URLs --- spec/coverage/reporter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/coverage/reporter.js b/spec/coverage/reporter.js index 384e99fc1..e813eed52 100644 --- a/spec/coverage/reporter.js +++ b/spec/coverage/reporter.js @@ -86,7 +86,10 @@ const patchBrowserWindow = () => { const {destroy} = BrowserWindow.prototype BrowserWindow.prototype.destroy = function () { - if (this.isDestroyed()) return destroy.call(this) + if (this.isDestroyed() || !this.getURL()) { + return destroy.call(this) + } + getCoverageFromWebContents(this.webContents, (coverage, pid) => { saveCoverageData(coverage, pid) destroy.call(this)