Check if parentNode exists
We need to check if parentNode exists, as in some scenarios it does not (e.g. phantomjs < 2)
This commit is contained in:
parent
4a7f27356a
commit
633f1f53d3
@ -70,6 +70,6 @@ exports.remove = function (element) {
|
|||||||
if (typeof element.remove !== 'undefined') {
|
if (typeof element.remove !== 'undefined') {
|
||||||
element.remove();
|
element.remove();
|
||||||
} else {
|
} else {
|
||||||
element.parentNode.removeChild(element);
|
element.parentNode && element.parentNode.removeChild(element);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user