From ed8df56ff0bfe4bf907ffdd64faf20ded11c0229 Mon Sep 17 00:00:00 2001 From: Lee Kelleher Date: Wed, 28 Feb 2024 16:15:42 +0000 Subject: [PATCH] Checks that `contentType` isn't `null` before checking for `.ListView` (#15791) For a collection use at the Media root, the `contentType` will be `null`, and not have a `.ListView` configured, so would need to fallback to the default collection configuration (data-type). This was a small regression in PR #15687. https://github.com/umbraco/Umbraco-CMS/pull/15687/files#diff-2ad7a39ca3a7e9fd7c4cbc72a2a28b28bf0d24c12449beff76ff8eb3b0a3ce99L192 --- .../Services/ContentListViewServiceBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Infrastructure/Services/ContentListViewServiceBase.cs b/src/Umbraco.Infrastructure/Services/ContentListViewServiceBase.cs index 7857051cb6..015d5c69c0 100644 --- a/src/Umbraco.Infrastructure/Services/ContentListViewServiceBase.cs +++ b/src/Umbraco.Infrastructure/Services/ContentListViewServiceBase.cs @@ -189,7 +189,7 @@ internal abstract class ContentListViewServiceBase> GetListViewConfigurationFromContentTypeAsync(TContentType? contentType) { - if (contentType?.ListView is null) + if (contentType is not null && contentType.ListView is null) { return Attempt.FailWithStatus(ContentCollectionOperationStatus.ContentNotCollection, null); }