-In the send assets screen it crashes when type an amount

feat_androidx_migration
dtvv 2018-10-25 01:34:48 -05:00
parent 418749ea6a
commit 2ca94de241
1 changed files with 6 additions and 1 deletions

View File

@ -48,7 +48,12 @@ public class AmountValidationField extends ValidationField {
CryptoCoinBalance balance = CrystalDatabase.getAppDatabase(amountField.getContext()).cryptoCoinBalanceDao().getBalanceFromAccount(this.account.getId(),cryptoCurrency.getId());
if (newAmountValue > balance.getBalance()){
double balanceDouble = 0;
if(balance != null){
balanceDouble = balance.getBalance();
}
if (newAmountValue > balanceDouble){
setMessageForValue(mixedValues, validator.getContext().getResources().getString(R.string.insufficient_amount));
setValidForValue(mixedValues, false);
} else if (newAmountValue == 0){