Skip to content

Commit

Permalink
[MoneyBundle] fix issue with not-nullable types and null values
Browse files Browse the repository at this point in the history
  • Loading branch information
dpfaffenbauer committed Nov 28, 2022
1 parent fe25979 commit 14eea47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CoreShop/Bundle/MoneyBundle/CoreExtension/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,10 @@ public function getDataFromEditmode($data, $object = null, $params = [])
return (int) round((round((float) $data, $this->getDecimalPrecision()) * $this->getDecimalFactor()), 0);
}

if (null === $data && !$this->nullable) {
$data = 0;
}

return $data;
}

Expand Down

0 comments on commit 14eea47

Please sign in to comment.