From 19fa5e17a577dd6117aeeb9ffd95ddc19244d8c4 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Fri, 8 Jan 2021 22:20:06 -0600 Subject: [PATCH] Fix JSONEditor bug with undefined value (#379) --- .../Controls/JsonEditor/JsonEditorComponent.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Explorer/Controls/JsonEditor/JsonEditorComponent.ts b/src/Explorer/Controls/JsonEditor/JsonEditorComponent.ts index 459f3b884..7611fe567 100644 --- a/src/Explorer/Controls/JsonEditor/JsonEditorComponent.ts +++ b/src/Explorer/Controls/JsonEditor/JsonEditorComponent.ts @@ -59,10 +59,12 @@ export class JsonEditorViewModel extends WaitsForTemplateViewModel { this.params = params; this.params.content.subscribe((newValue: string) => { - if (!!this.editor) { - this.editor.getModel().setValue(newValue); - } else { - this.createEditor(newValue, this.configureEditor.bind(this)); + if (newValue) { + if (!!this.editor) { + this.editor.getModel().setValue(newValue); + } else { + this.createEditor(newValue, this.configureEditor.bind(this)); + } } });