diff --git a/desktop/src/main/java/haveno/desktop/main/account/content/cryptoaccounts/CryptoAccountsDataModel.java b/desktop/src/main/java/haveno/desktop/main/account/content/cryptoaccounts/CryptoAccountsDataModel.java index 943c5e9951..7fc3089a1f 100644 --- a/desktop/src/main/java/haveno/desktop/main/account/content/cryptoaccounts/CryptoAccountsDataModel.java +++ b/desktop/src/main/java/haveno/desktop/main/account/content/cryptoaccounts/CryptoAccountsDataModel.java @@ -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(); }