From 029c11201166bdd4eef0c0c2ce9a66847fa3c2fa Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Mon, 22 Jun 2020 16:44:41 -0400 Subject: [PATCH] client/html: fix upload error when pool input is disabled --- client/js/controls/post_edit_sidebar_control.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js index c6b7c226..b8ad9dab 100644 --- a/client/js/controls/post_edit_sidebar_control.js +++ b/client/js/controls/post_edit_sidebar_control.js @@ -236,10 +236,12 @@ class PostEditSidebarControl extends events.EventTarget { ); } - this._poolControl.addEventListener("change", (e) => { - this.dispatchEvent(new CustomEvent("change")); - this._syncExpanderTitles(); - }); + if (this._poolControl) { + this._poolControl.addEventListener("change", (e) => { + this.dispatchEvent(new CustomEvent("change")); + this._syncExpanderTitles(); + }); + } } _syncExpanderTitles() {