1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00

Prevent possible error when a node has no children (#2108)

Compat with Edge; SVG nodes don't have a `children` property and therefore this throws an error whenever an SVG is added, removed or moved in the DOM.
This commit is contained in:
Nik Rolls 2016-10-31 09:04:53 +13:00 committed by Raymond Hill
parent 015d38dc8c
commit be8e514464

View File

@ -1086,7 +1086,7 @@ vAPI.domCollapser = (function() {
if ( node.localName === 'iframe' ) {
addIFrame(node);
}
if ( node.children.length !== 0 ) {
if ( node.children && node.children.length !== 0 ) {
var iframes = node.getElementsByTagName('iframe');
if ( iframes.length !== 0 ) {
addIFrames(iframes);