mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-21 22:58:49 +00:00
Handle price_change_percentage_24h being null and not able to parse as double
This commit is contained in:
parent
a79d8a802f
commit
14f9dc2c05
1 changed files with 2 additions and 2 deletions
|
@ -105,8 +105,8 @@ class PriceAPI {
|
||||||
final coin = coinFromPrettyName(coinName);
|
final coin = coinFromPrettyName(coinName);
|
||||||
|
|
||||||
final price = Decimal.parse(map["current_price"].toString());
|
final price = Decimal.parse(map["current_price"].toString());
|
||||||
final change24h =
|
final change24h = map["price_change_percentage_24h"] != null ?
|
||||||
double.parse(map["price_change_percentage_24h"].toString());
|
double.parse(map["price_change_percentage_24h"].toString()) : 0.0;
|
||||||
|
|
||||||
result[coin] = Tuple2(price, change24h);
|
result[coin] = Tuple2(price, change24h);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue