mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Merge pull request #6177 from xyzmaker123/fix-edit-account-npe
Fix NPE on edition of CBM FasterPayments and USPostal accounts
This commit is contained in:
commit
f5bb7a03fc
@ -141,7 +141,7 @@ public class CashByMailForm extends PaymentMethodForm {
|
||||
@Override
|
||||
public void updateAllInputsValid() {
|
||||
allInputsValid.set(isAccountNameValid()
|
||||
&& !postalAddressTextArea.getText().isEmpty()
|
||||
&& !cashByMailAccount.getPostalAddress().isEmpty()
|
||||
&& inputValidator.validate(cashByMailAccount.getContact()).isValid
|
||||
&& paymentAccount.getSingleTradeCurrency() != null);
|
||||
}
|
||||
|
@ -60,6 +60,8 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||
private InputTextField holderNameInputTextField;
|
||||
private InputTextField accountNrInputTextField;
|
||||
private InputTextField sortCodeInputTextField;
|
||||
private final BranchIdValidator branchIdValidator;
|
||||
private final AccountNrValidator accountNrValidator;
|
||||
|
||||
public FasterPaymentsForm(PaymentAccount paymentAccount,
|
||||
AccountAgeWitnessService accountAgeWitnessService,
|
||||
@ -69,6 +71,8 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||
CoinFormatter formatter) {
|
||||
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
||||
this.fasterPaymentsAccount = (FasterPaymentsAccount) paymentAccount;
|
||||
this.branchIdValidator = new BranchIdValidator("GB");
|
||||
this.accountNrValidator = new AccountNrValidator("GB");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -84,14 +88,14 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||
// do not translate as it is used in English only
|
||||
sortCodeInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, UK_SORT_CODE);
|
||||
sortCodeInputTextField.setValidator(inputValidator);
|
||||
sortCodeInputTextField.setValidator(new BranchIdValidator("GB"));
|
||||
sortCodeInputTextField.setValidator(branchIdValidator);
|
||||
sortCodeInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
fasterPaymentsAccount.setSortCode(newValue);
|
||||
updateFromInputs();
|
||||
});
|
||||
|
||||
accountNrInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("payment.accountNr"));
|
||||
accountNrInputTextField.setValidator(new AccountNrValidator("GB"));
|
||||
accountNrInputTextField.setValidator(accountNrValidator);
|
||||
accountNrInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
fasterPaymentsAccount.setAccountNr(newValue);
|
||||
updateFromInputs();
|
||||
@ -134,9 +138,9 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||
@Override
|
||||
public void updateAllInputsValid() {
|
||||
allInputsValid.set(isAccountNameValid()
|
||||
&& holderNameInputTextField.getValidator().validate(fasterPaymentsAccount.getHolderName()).isValid
|
||||
&& sortCodeInputTextField.getValidator().validate(fasterPaymentsAccount.getSortCode()).isValid
|
||||
&& accountNrInputTextField.getValidator().validate(fasterPaymentsAccount.getAccountNr()).isValid
|
||||
&& inputValidator.validate(fasterPaymentsAccount.getHolderName()).isValid
|
||||
&& branchIdValidator.validate(fasterPaymentsAccount.getSortCode()).isValid
|
||||
&& accountNrValidator.validate(fasterPaymentsAccount.getAccountNr()).isValid
|
||||
&& fasterPaymentsAccount.getTradeCurrencies().size() > 0);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
|
||||
public void updateAllInputsValid() {
|
||||
allInputsValid.set(isAccountNameValid()
|
||||
&& usPostalMoneyOrderValidator.validate(usPostalMoneyOrderAccount.getPostalAddress()).isValid
|
||||
&& !postalAddressTextArea.getText().isEmpty()
|
||||
&& !usPostalMoneyOrderAccount.getPostalAddress().isEmpty()
|
||||
&& inputValidator.validate(usPostalMoneyOrderAccount.getHolderName()).isValid
|
||||
&& usPostalMoneyOrderAccount.getTradeCurrencies().size() > 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user