Skip to content

Commit

Permalink
Prevented possible problem on getting unexists address
Browse files Browse the repository at this point in the history
  • Loading branch information
skoshelev committed Mar 10, 2021
1 parent e54e61d commit 831a897
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Libraries/Nop.Services/Customers/CustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

/// <summary>
Expand Down

0 comments on commit 831a897

Please sign in to comment.