From 6141456f2f72d1cb57ff0f3cbef5070d03b1c83a 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); } },