Skip to content

Commit

Permalink
Check if parentNode exists
Browse files Browse the repository at this point in the history
We need to check if parentNode exists, as in some scenarios it does not (e.g. phantomjs < 2)
  • Loading branch information
DanielApt committed Mar 27, 2015
1 parent 4a7f273 commit 633f1f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/lib/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

0 comments on commit 633f1f5

Please sign in to comment.