-In the send assets screen it crashes when type an amount
This commit is contained in:
parent
418749ea6a
commit
2ca94de241
1 changed files with 6 additions and 1 deletions
|
@ -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){
|
||||||
|
|
Loading…
Reference in a new issue