From 3e1cb3905e9e2843860326e5748cb67d801cf078 Mon Sep 17 00:00:00 2001 From: Serhii Date: Tue, 3 Dec 2024 00:26:33 +0200 Subject: [PATCH] fix infinity values in LetsExchange fixed rate (#1849) Co-authored-by: Omar Hatem --- lib/exchange/provider/letsexchange_exchange_provider.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/exchange/provider/letsexchange_exchange_provider.dart b/lib/exchange/provider/letsexchange_exchange_provider.dart index 1d4da55cb..0a2f81317 100644 --- a/lib/exchange/provider/letsexchange_exchange_provider.dart +++ b/lib/exchange/provider/letsexchange_exchange_provider.dart @@ -97,6 +97,8 @@ class LetsExchangeExchangeProvider extends ExchangeProvider { final amountToGet = double.tryParse(responseJSON['amount'] as String) ?? 0.0; + if (amountToGet == 0.0) return 0.0; + return isFixedRateMode ? amount / amountToGet : amountToGet / amount; } catch (e) { log(e.toString());