From ec77b2fa1ba254430652bee8af944278720f7137 Mon Sep 17 00:00:00 2001 From: Mole Date: Thu, 20 Feb 2025 14:14:57 +0100 Subject: [PATCH] Check null in cachevalue for (#18395) --- src/Umbraco.PublishedCache.HybridCache/PublishedProperty.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Umbraco.PublishedCache.HybridCache/PublishedProperty.cs b/src/Umbraco.PublishedCache.HybridCache/PublishedProperty.cs index 577c929f2c..187b558385 100644 --- a/src/Umbraco.PublishedCache.HybridCache/PublishedProperty.cs +++ b/src/Umbraco.PublishedCache.HybridCache/PublishedProperty.cs @@ -275,6 +275,12 @@ internal class PublishedProperty : PublishedPropertyBase public CacheValue For(string? culture, string? segment) { + // As noted on IPropertyValue, null value means invariant + // But as we need an actual string value to build a CompositeStringStringKey + // We need to convert null to empty + culture ??= string.Empty; + segment ??= string.Empty; + if (culture == string.Empty && segment == string.Empty) { return this;