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

This commit is contained in:
dtvv 2018-10-25 01:34:48 -05:00
parent 418749ea6a
commit 2ca94de241

View file

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