Catch null

This commit is contained in:
James Cole
2023-12-22 10:16:10 +01:00
parent c5fbf6ec55
commit e8890ada7c
2 changed files with 19 additions and 24 deletions

View File

@@ -183,6 +183,14 @@ class ExchangeRateConverter
;
++$this->queryCount;
$rate = (string) $result?->rate;
if ('' === $rate) {
return null;
}
if('0' === $rate) {
return null;
}
$cache->store($rate);
// if the rate has not been cached during this particular run, save it
@@ -198,10 +206,6 @@ class ExchangeRateConverter
],
];
if ('' === $rate) {
return null;
}
return $rate;
}