From dea339db7eec4c100c6ba3049df847ffcb0aa89a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 15 Nov 2023 21:44:03 +0100 Subject: [PATCH] fix code editor issue --- .../packages/templating/code-editor/code-editor.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/code-editor/code-editor.controller.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/code-editor/code-editor.controller.ts index 3ce2e64817..f30c2e42a4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/code-editor/code-editor.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/code-editor/code-editor.controller.ts @@ -97,9 +97,9 @@ export class UmbCodeEditorController { set value(newValue: string) { if (!this.#editor) throw new Error('Editor object not found'); - const oldValue = this.value; + const oldValue = this.value ?? ''; if (newValue !== oldValue) { - this.#editor.setValue(newValue); + this.#editor.setValue(newValue ?? ''); } } /**