Add nullability to nucache & lucene projects

This commit is contained in:
Nikolaj Geisle
2022-03-30 13:34:56 +02:00
parent b52c4e50cf
commit 05a08bef63
105 changed files with 736 additions and 619 deletions

View File

@@ -6,12 +6,12 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
{
public static class DomainCacheExtensions
{
public static bool GetAssignedWithCulture(this IDomainCache domainCache, string culture, int documentId, bool includeWildcards = false)
public static bool GetAssignedWithCulture(this IDomainCache domainCache, string? culture, int documentId, bool includeWildcards = false)
{
var assigned = domainCache.GetAssigned(documentId, includeWildcards);
// It's super important that we always compare cultures with ignore case, since we can't be sure of the casing!
return culture is null ? assigned.Any() : assigned.Any(x => x.Culture.Equals(culture, StringComparison.InvariantCultureIgnoreCase));
return culture is null ? assigned.Any() : assigned.Any(x => x.Culture?.Equals(culture, StringComparison.InvariantCultureIgnoreCase) ?? false);
}
}
}