diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs index 1a216363f..c56e203b2 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/External/ExternalLocalizationTextStoreCache.cs @@ -84,14 +84,15 @@ public class ExternalLocalizationTextStoreCache : IExternalLocalizationTextStore var stampCacheKey = ExternalLocalizationTextStampCacheItem.CalculateCacheKey(resource.ResourceName, cultureName); var stampCacheItem = await StampCache.GetAsync(stampCacheKey); - if (memoryCacheItem != null && memoryCacheItem.CacheStamp == stampCacheItem.Stamp) + + if (memoryCacheItem != null && memoryCacheItem.CacheStamp == stampCacheItem?.Stamp) { memoryCacheItem.LastCheckTime = DateTime.Now; return memoryCacheItem.Texts; } var distributeCacheItem = await DistributedCache.GetAsync(cacheKey); - if (distributeCacheItem != null) + if (stampCacheItem != null && distributeCacheItem != null) { MemoryCache[cacheKey] = new LocalizationTextMemoryCacheItem(distributeCacheItem.Texts, stampCacheItem.Stamp);