diff --git a/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart b/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart index b609d18ec..55df4d26e 100644 --- a/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart +++ b/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart @@ -214,8 +214,12 @@ class MorphTokenExchangeProvider extends ExchangeProvider { final response = await get(url); final responseJSON = json.decode(response.body) as Map; final rate = responseJSON['data'][from.toString()][to.toString()] as String; - final estimatedAmount = double.parse(rate) * amount; - return estimatedAmount; + try { + final estimatedAmount = double.parse(rate) * amount; + return estimatedAmount; + } catch(e) { + return 0.0; + } } }