Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Catch division by zero. https://github.com/firefly-iii/firefly-iii/issues/8297
James Colede5cb4c1650b
diff --git a/app/Support/Http/Api/ExchangeRateConverter.php b/app/Support/Http/Api/ExchangeRateConverter.phpindex ee94070233..c64e8f34e3 100644--- a/app/Support/Http/Api/ExchangeRateConverter.php+++ b/app/Support/Http/Api/ExchangeRateConverter.php@@ -156,7 +156,7 @@ class ExchangeRateConverter// perhaps the rate has been cached during this particular run$preparedRate = $this->prepared[$date][$from][$to] ?? null;- if (null !== $preparedRate && '0' !== $preparedRate) {+ if (null !== $preparedRate && 0 !== bccomp('0', $preparedRate)) {return $preparedRate;}@@ -187,7 +187,7 @@ class ExchangeRateConverterif ('' === $rate) {return null;}- if('0' === $rate) {+ if (0 === bccomp('0', $preparedRate)) {return null;}