From 831a897644852a7c8dc272a829ef8355f2ea7265 Mon Sep 17 00:00:00 2001 From: skoshelev Date: Wed, 10 Mar 2021 11:53:53 +0300 Subject: [PATCH] Prevented possible problem on getting unexists address --- src/Libraries/Nop.Services/Customers/CustomerService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Libraries/Nop.Services/Customers/CustomerService.cs b/src/Libraries/Nop.Services/Customers/CustomerService.cs index edfb7882c8f..d4d86ca4772 100644 --- a/src/Libraries/Nop.Services/Customers/CustomerService.cs +++ b/src/Libraries/Nop.Services/Customers/CustomerService.cs @@ -1668,7 +1668,7 @@ join cam in _customerAddressMappingRepository.Table on address.Id equals cam.Add var key = _staticCacheManager.PrepareKeyForShortTermCache(NopCustomerServicesDefaults.CustomerAddressCacheKey, customerId, addressId); - return await _staticCacheManager.GetAsync(key, async () => await query.SingleAsync()); + return await _staticCacheManager.GetAsync(key, async () => await query.FirstOrDefaultAsync()); } ///