From 633f1f53d3dc176c6b554563a9533d05e3eefebe Mon Sep 17 00:00:00 2001 From: DanielApt Date: Fri, 27 Mar 2015 16:58:10 +0000 Subject: [PATCH] Check if parentNode exists We need to check if parentNode exists, as in some scenarios it does not (e.g. phantomjs < 2) --- src/js/lib/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/lib/dom.js b/src/js/lib/dom.js index 48e785ffb..8d6b4faa3 100644 --- a/src/js/lib/dom.js +++ b/src/js/lib/dom.js @@ -70,6 +70,6 @@ exports.remove = function (element) { if (typeof element.remove !== 'undefined') { element.remove(); } else { - element.parentNode.removeChild(element); + element.parentNode && element.parentNode.removeChild(element); } };