Fixed exception, when a part does not have price informations.

This commit is contained in:
Jan Böhmer 2019-08-06 17:15:37 +02:00
parent a916c40aa3
commit 717b257778
2 changed files with 2 additions and 2 deletions

View file

@ -665,7 +665,7 @@ class Part extends AttachmentContainingDBElement
*
* @throws \Exception if there was an error
*/
public function getAveragePrice(int $quantity = 1, $multiplier = null) : float
public function getAveragePrice(int $quantity = 1, $multiplier = null) : ?float
{
$prices = $this->getPrices($quantity, $multiplier, true);
$average_price = null;