Add missing sanity check when fetching single price datapoint

This commit is contained in:
nymkappa committed 2023-03-29 17:33:07 +09:00
1 parent 5977251a20
commit ea2193a42d
1 file changed
+1 -1
+1 -1
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();
}