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