Add missing sanity check when fetching single price datapoint

This commit is contained in:
nymkappa 2023-03-27 20:02:33 +09:00
parent 5977251a20
commit ea2193a42d
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

View File

@ -160,7 +160,7 @@ class PricesRepository {
// Compute fiat exchange rates
let latestPrice = rates[0] as ApiPrice;
if (latestPrice.USD === -1) {
if (!latestPrice || latestPrice.USD === -1) {
latestPrice = priceUpdater.getEmptyPricesObj();
}