From cb9411b2a842cc7d18cd9ed57d803107c3d6fd71 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 19 Sep 2022 10:52:39 +0200 Subject: [PATCH] add null check for selection --- .../views/edit/editor-view-data-type-edit.element.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts index 56d3e8a56b..ac0bd00fcb 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/editors/data-type/views/edit/editor-view-data-type-edit.element.ts @@ -143,10 +143,10 @@ export class UmbEditorViewDataTypeEditElement extends UmbContextConsumerMixin(Li const selection = [this._dataType.propertyEditorAlias] || []; const modalHandler = this._modalService?.propertyEditorPicker({ selection }); - modalHandler?.onClose().then((returnValue) => { - if (!returnValue.selection) return; + modalHandler?.onClose().then(({ selection } = {}) => { + if (!selection) return; - const propertyEditorAlias = returnValue.selection[0]; + const propertyEditorAlias = selection[0]; this._selectPropertyEditor(propertyEditorAlias); }); } @@ -164,10 +164,10 @@ export class UmbEditorViewDataTypeEditElement extends UmbContextConsumerMixin(Li const selection = [this._dataType.propertyEditorUIAlias] || []; const modalHandler = this._modalService?.propertyEditorUIPicker({ selection }); - modalHandler?.onClose().then((returnValue) => { - if (!returnValue.selection) return; + modalHandler?.onClose().then(({ selection } = {}) => { + if (!selection) return; - const propertyEditorUIAlias = returnValue.selection[0]; + const propertyEditorUIAlias = selection[0]; this._selectPropertyEditorUI(propertyEditorUIAlias); }); }