Skip to content

Commit

Permalink
Fix Illegal invocation when accessing childNodes for pages including …
Browse files Browse the repository at this point in the history
…Universal Viewer video #72197
  • Loading branch information
davisrtilde committed Jul 29, 2024
1 parent 7211042 commit 90f8974
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/polyfills/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ if (!Element.prototype.closest) {
constructor.prototype.children == null) {
Object.defineProperty(constructor.prototype, 'children', {
get: function() {
let i = 0, node, nodes = this.childNodes, children = [];
let nodes = [];
try {
nodes = this.childNodes;
} catch(error) {
console.log(error);
}
let i = 0, node, children = [];
while (node = nodes[i++]) {
if (node.nodeType === 1) {
children.push(node);
Expand Down

0 comments on commit 90f8974

Please sign in to comment.