From 5c16cfb9475b5e7559dfd00ec5a352e6cc92207d Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 18 Apr 2024 20:44:26 +0200 Subject: [PATCH] Use TryGetValue instead --- .../PropertyEditors/BlockEditorValues.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs b/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs index 2390445225..34c129773c 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/BlockEditorValues.cs @@ -83,8 +83,7 @@ internal class BlockEditorValues private bool ResolveBlockItemData(BlockItemData block, Dictionary> contentTypePropertyTypes, IDictionary contentTypesDictionary) { - IContentType? contentType = contentTypesDictionary[block.ContentTypeKey]; - if (contentType == null) + if (contentTypesDictionary.TryGetValue(block.ContentTypeKey, out IContentType? contentType) is false) { return false; }