From cc183524fd0c6db3ce76233ef532c3a8a1f629d5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 19 Dec 2016 16:37:47 -0800 Subject: [PATCH] Only remove webview when non-null --- spec/api-session-spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/api-session-spec.js b/spec/api-session-spec.js index 56d34da92ec..1f31ff7123e 100644 --- a/spec/api-session-spec.js +++ b/spec/api-session-spec.js @@ -25,10 +25,12 @@ describe('session module', function () { }) afterEach(function () { - if (!document.body.contains(webview)) { - document.body.appendChild(webview) + if (webview != null) { + if (!document.body.contains(webview)) { + document.body.appendChild(webview) + } + webview.remove() } - webview.remove() return closeWindow(w).then(function () { w = null }) })