add check to prevent null payment account name

This commit is contained in:
woodser 2023-12-15 12:22:48 -05:00
parent 48d902b58d
commit fe70a087c4

View File

@ -119,6 +119,7 @@ class CryptoAccountsDataModel extends ActivatableDataModel {
});
}
if (paymentAccount.getAccountName() == null) throw new IllegalStateException("Account name cannot be null");
user.addPaymentAccount(paymentAccount);
if (!(paymentAccount instanceof AssetAccount))
@ -126,6 +127,7 @@ class CryptoAccountsDataModel extends ActivatableDataModel {
}
public void onUpdateAccount(PaymentAccount paymentAccount) {
if (paymentAccount.getAccountName() == null) throw new IllegalStateException("Account name cannot be null");
paymentAccount.onPersistChanges();
user.requestPersistence();
}