From 4351c20414735134e82e5fccbcd67b51e4178957 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Sun, 10 Jul 2022 11:48:14 -0500 Subject: [PATCH] Fix NPE in account name creation. --- .../components/paymentmethods/PaymentMethodForm.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java index c12bec190ab..a6b52cd7021 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java @@ -71,6 +71,8 @@ import lombok.extern.slf4j.Slf4j; +import javax.annotation.Nullable; + import static bisq.desktop.util.DisplayUtils.createAccountName; import static bisq.desktop.util.FormBuilder.*; @@ -286,9 +288,9 @@ void applyTradeCurrency(TradeCurrency tradeCurrency, FiatCurrency defaultCurrenc } } - void setAccountNameWithString(String name) { + void setAccountNameWithString(@Nullable String name) { if (useCustomAccountNameToggleButton != null && !useCustomAccountNameToggleButton.isSelected()) { - String accountName = createAccountName(paymentAccount.getPaymentMethod().getId(), name); + String accountName = createAccountName(paymentAccount.getPaymentMethod().getId(), name == null ? "" : name); accountNameTextField.setText(accountName); } }