Fix null reference exception in CacheValues.For when building the CompositeStringStringKey (#17024)
* Fix null ref exeption based on IPropertyValue.Culture documentation * Clarify comment
This commit is contained in:
@@ -371,6 +371,12 @@ internal class Property : 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;
|
||||
|
||||
Reference in New Issue
Block a user