From 76ad99beb015d390ad6fd8f91bf464d9a01c321d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20M=C3=B8rch=20Schou?= Date: Fri, 16 Jun 2023 19:22:39 +0200 Subject: [PATCH] Makes sure the nucache is not truncated when its null (#14395) * Makes sure the nucache is not truncated when its null * Removed parentheses (cherry picked from commit 0a4a938b887bac7f2c4a74715fda2c7780b03c03) --- .../Persistence/NuCacheContentRepository.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs index b7fac1e7bc..75208b2b16 100644 --- a/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs +++ b/src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs @@ -109,9 +109,9 @@ public class NuCacheContentRepository : RepositoryBase, INuCacheContentRepositor | ContentCacheDataSerializerEntityType.Member); // If contentTypeIds, mediaTypeIds and memberTypeIds are null, truncate table as all records will be deleted (as these 3 are the only types in the table). - if ((contentTypeIds == null || !contentTypeIds.Any()) - && (mediaTypeIds == null || !mediaTypeIds.Any()) - && (memberTypeIds == null || !memberTypeIds.Any())) + if (contentTypeIds != null && !contentTypeIds.Any() + && mediaTypeIds != null && !mediaTypeIds.Any() + && memberTypeIds != null && !memberTypeIds.Any()) { if (Database.DatabaseType == DatabaseType.SqlServer2012) {