Skip to content

Commit 3bc921f

Browse files
committed
ensure if a certain app coin is not found that the price call still works for the others
1 parent 5a99a33 commit 3bc921f

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

lib/services/price.dart

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,19 @@ class PriceAPI {
159159

160160
for (final map in coinGeckoData) {
161161
final String coinName = map["name"] as String;
162-
final coin = AppConfig.getCryptoCurrencyByPrettyName(
163-
coinName == "Factor" ? "Fact0rn" : coinName,
164-
);
162+
late CryptoCurrency coin;
163+
try {
164+
coin = AppConfig.getCryptoCurrencyByPrettyName(
165+
coinName == "Factor" ? "Fact0rn" : coinName,
166+
);
167+
} catch (e, s) {
168+
Logging.instance.e(
169+
"Failed to find matching app coin for $coinName. Moving on",
170+
error: e,
171+
stackTrace: s,
172+
);
173+
continue;
174+
}
165175

166176
try {
167177
final price = Decimal.parse(map["current_price"].toString());

0 commit comments

Comments
 (0)