From 4e148aaa848380b3970344aad70562e53040226f Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 5 Jan 2023 14:14:14 +0100 Subject: [PATCH] add null check --- .../views/edit/workspace-view-data-type-edit.element.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/workspace/views/edit/workspace-view-data-type-edit.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/workspace/views/edit/workspace-view-data-type-edit.element.ts index aeecef13fa..f6023e45ba 100644 --- a/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/workspace/views/edit/workspace-view-data-type-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/backoffice/settings/data-types/workspace/views/edit/workspace-view-data-type-edit.element.ts @@ -1,15 +1,14 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib'; import { css, html, nothing } from 'lit'; import { customElement, state } from 'lit/decorators.js'; +import { UmbLitElement } from '@umbraco-cms/element'; import { UmbModalService } from '../../../../../../core/modal'; import { UmbWorkspaceDataTypeContext } from '../../workspace-data-type.context'; -import { UmbDataTypeStoreItemType } from '../../../data-type.store'; import type { DataTypeDetails, ManifestPropertyEditorUI } from '@umbraco-cms/models'; import { umbExtensionsRegistry } from '@umbraco-cms/extensions-registry'; import '../../../../../shared/property-editors/shared/property-editor-config/property-editor-config.element'; import '../../../../../shared/components/ref-property-editor-ui/ref-property-editor-ui.element'; -import { UmbLitElement } from '@umbraco-cms/element'; @customElement('umb-workspace-view-data-type-edit') export class UmbWorkspaceViewDataTypeEditElement extends UmbLitElement { @@ -81,6 +80,9 @@ export class UmbWorkspaceViewDataTypeEditElement extends UmbLitElement { this.observe( umbExtensionsRegistry.getByAlias(propertyEditorUIAlias), (propertyEditorUI) => { + // TODO: show error. We have stored a PropertyEditorUIAlias and can't find the PropertyEditorUI in the registry. + if (!propertyEditorUI) return; + this._propertyEditorUIName = propertyEditorUI?.meta.label ?? propertyEditorUI?.name ?? ''; this._propertyEditorUIAlias = propertyEditorUI?.alias ?? ''; this._propertyEditorUIIcon = propertyEditorUI?.meta?.icon ?? '';