Skip to content

Commit

Permalink
EWM-260. Fix amount parse (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
knightsforce authored Sep 17, 2024
1 parent ddf8341 commit e346e6b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,14 @@ class _WalletPrepareTransferAmountInputState
state.hasError ? theme.colors.contentNegative : theme.colors.content0,
);
final price = Fixed.parse(widget.selectedAsset?.currency?.price ?? '0');
final amount = Fixed.parse(state.value.nullIf('') ?? '0');

late Fixed amount;
try {
amount = Fixed.parse(state.value.nullIf('') ?? '0');
} catch (e) {
amount = Fixed.parse('0');
}

final usd = Fixed.copyWith(amount * price, scale: 2);

return Column(
Expand Down

0 comments on commit e346e6b

Please sign in to comment.