From 26dfaa065a66d4db14679166e00d80a531816e58 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 27 Jan 2023 15:32:23 -0600 Subject: [PATCH] don't set errorMessage as substring except for >max crypto amt errors --- lib/pages/buy_view/buy_form.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pages/buy_view/buy_form.dart b/lib/pages/buy_view/buy_form.dart index 365b8bc94..525aa5e83 100644 --- a/lib/pages/buy_view/buy_form.dart +++ b/lib/pages/buy_view/buy_form.dart @@ -500,10 +500,10 @@ class _BuyFormState extends ConsumerState { } else { // Error; probably amount out of bounds String errorMessage = "${quoteResponse.exception?.errorMessage}"; - errorMessage = errorMessage.substring( - (errorMessage.indexOf('getQuote exception: ') ?? 19) + 20, - errorMessage.indexOf(", value: null")); if (errorMessage.contains('must be between')) { + errorMessage = errorMessage.substring( + (errorMessage.indexOf('getQuote exception: ') ?? 19) + 20, + errorMessage.indexOf(", value: null")); _BuyFormState.boundedCryptoTicker = errorMessage.substring( errorMessage.indexOf('The ') + 4, errorMessage.indexOf(' amount must be between'));