Skip to content

Commit 995a927

Browse files
committed
Add missing check
1 parent 54ea0f3 commit 995a927

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/External/Model/Ingredient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static function fromModel(IngredientModel $model, bool $useFileURI = fals
5858
})->toArray();
5959

6060
$defaultIngredientUnits = $model->getDefaultUnits();
61-
if ($model->getDefaultUnits()?->isConvertable()) {
61+
if ($model->getDefaultUnits()?->isConvertable() && $toUnits) {
6262
$defaultIngredientUnits = new UnitValueObject($toUnits->value);
6363
}
6464

0 commit comments

Comments
 (0)