diff --git a/src/Services/PricedetailHelper.php b/src/Services/PricedetailHelper.php index d36ce4d7..c4a24a6b 100644 --- a/src/Services/PricedetailHelper.php +++ b/src/Services/PricedetailHelper.php @@ -174,8 +174,12 @@ class PricedetailHelper continue; } - $avg = bcadd($avg, $this->convertMoneyToCurrency($pricedetail->getPricePerUnit(), $pricedetail->getCurrency(), $currency), Pricedetail::PRICE_PRECISION); - ++$count; + $converted = $this->convertMoneyToCurrency($pricedetail->getPricePerUnit(), $pricedetail->getCurrency(), $currency); + //Ignore price informations that can not be converted to base currency. + if ($converted !== null) { + $avg = bcadd($avg, $converted, Pricedetail::PRICE_PRECISION); + ++$count; + } } if (0 === $count) {