From 4cdfdbf9d544270e95076a057ba75d4d0d0c6bb1 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Tue, 23 May 2023 10:10:52 +0200 Subject: [PATCH] FIX: ensure element is present before passing on insertText event --- .../discourse/initializers/custom-wizard-edits.js.es6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6 b/assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6 index 2d13e703..7eed8faf 100644 --- a/assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6 +++ b/assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6 @@ -69,7 +69,7 @@ export default { }, _wizardInsertText(text, options) { - if (this.session.wizardEventFieldId === this.fieldId) { + if (this.session.wizardEventFieldId === this.fieldId && this.element) { this.insertText(text, options); } },