Skip to content

Commit d3256f8

Browse files
committed
Make sure that addedNodes are an Element, not a text node.
1 parent 7e9a714 commit d3256f8

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

jquery.initialize.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
// Otherwise, search for added nodes.
7575
// Search added nodes only for matching selectors.
7676
for (var n = 0; n < mutations[m].addedNodes.length; n++) {
77+
if (!(mutations[m].addedNodes[n] instanceof Element)) continue;
7778

7879
mutations[m].addedNodes[n].querySelectorAll(msobserver.selector).forEach(add);
7980
if (mutations[m].addedNodes[n].matches(msobserver.selector)) {
@@ -90,6 +91,7 @@
9091
matches.push(mutations[m].target);
9192
} else if (mutations[m].type == 'childList') {
9293
for (var n = 0; n < mutations[m].addedNodes.length; n++) {
94+
if (!(mutations[m].addedNodes[n] instanceof Element)) continue;
9395
if (mutations[m].addedNodes[n].matches(msobserver.selector))
9496
matches.push(mutations[m].addedNodes[n]);
9597
}

jquery.initialize.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)