Skip to content

Commit

Permalink
Fix error if collection of the products is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegoO committed Jul 21, 2020
1 parent 3cca2b6 commit aabcc36
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ApiPricingController(IWorkContextAccessor workContextAccessor, IStorefron
[ValidateAntiForgeryToken]
public async Task<ActionResult<ProductPrice[]>> GetActualProductPrices([FromBody] Product[] products)
{
if (products != null)
if (products != null && products.Any())
{
//Evaluate products prices
await _pricingService.EvaluateProductPricesAsync(products, WorkContext);
Expand Down

0 comments on commit aabcc36

Please sign in to comment.