From aabcc36925410a2d67b118b314dcaffd477b81f9 Mon Sep 17 00:00:00 2001 From: OlegoO Date: Tue, 21 Jul 2020 10:27:40 +0200 Subject: [PATCH] Fix error if collection of the products is empty  --- .../Controllers/Api/ApiPricingController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VirtoCommerce.Storefront/Controllers/Api/ApiPricingController.cs b/VirtoCommerce.Storefront/Controllers/Api/ApiPricingController.cs index 2a8c7e567..e563dc72a 100644 --- a/VirtoCommerce.Storefront/Controllers/Api/ApiPricingController.cs +++ b/VirtoCommerce.Storefront/Controllers/Api/ApiPricingController.cs @@ -29,7 +29,7 @@ public ApiPricingController(IWorkContextAccessor workContextAccessor, IStorefron [ValidateAntiForgeryToken] public async Task> GetActualProductPrices([FromBody] Product[] products) { - if (products != null) + if (products != null && products.Any()) { //Evaluate products prices await _pricingService.EvaluateProductPricesAsync(products, WorkContext);