mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Catch division by zero. https://github.com/firefly-iii/firefly-iii/issues/8297
This commit is contained in:
@@ -156,7 +156,7 @@ class ExchangeRateConverter
|
|||||||
|
|
||||||
// perhaps the rate has been cached during this particular run
|
// perhaps the rate has been cached during this particular run
|
||||||
$preparedRate = $this->prepared[$date][$from][$to] ?? null;
|
$preparedRate = $this->prepared[$date][$from][$to] ?? null;
|
||||||
if (null !== $preparedRate && '0' !== $preparedRate) {
|
if (null !== $preparedRate && 0 !== bccomp('0', $preparedRate)) {
|
||||||
return $preparedRate;
|
return $preparedRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ class ExchangeRateConverter
|
|||||||
if ('' === $rate) {
|
if ('' === $rate) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if('0' === $rate) {
|
if (0 === bccomp('0', $preparedRate)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user