From 90f8974fca896b1e567d9d4963517deee8b13233 Mon Sep 17 00:00:00 2001 From: Davis Ragels Date: Mon, 29 Jul 2024 14:19:32 +0300 Subject: [PATCH] Fix Illegal invocation when accessing childNodes for pages including Universal Viewer video #72197 --- src/polyfills/custom.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/polyfills/custom.js b/src/polyfills/custom.js index 1f44752..4779432 100644 --- a/src/polyfills/custom.js +++ b/src/polyfills/custom.js @@ -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);