From e77b4b87c1a53a927460735b26e3d9258311d57a Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Tue, 18 Jan 2022 10:24:20 -0500 Subject: [PATCH] Fix null parentNode when rendering emby-select in react --- src/elements/emby-select/emby-select.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/elements/emby-select/emby-select.js b/src/elements/emby-select/emby-select.js index 6a04a7af29..d73277a89d 100644 --- a/src/elements/emby-select/emby-select.js +++ b/src/elements/emby-select/emby-select.js @@ -138,15 +138,15 @@ import 'webcomponents.js/webcomponents-lite'; label.innerHTML = this.getAttribute('label') || ''; label.classList.add('selectLabel'); label.htmlFor = this.id; - this.parentNode.insertBefore(label, this); + this.parentNode?.insertBefore(label, this); if (this.classList.contains('emby-select-withcolor')) { - this.parentNode.insertAdjacentHTML('beforeend', '
0
'); + this.parentNode?.insertAdjacentHTML('beforeend', '
0
'); } }; EmbySelectPrototype.setLabel = function (text) { - const label = this.parentNode.querySelector('label'); + const label = this.parentNode?.querySelector('label'); label.innerHTML = text; };