Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problems with editing account names #6167

Merged
merged 3 commits into from Apr 27, 2022
Merged

Fix problems with editing account names #6167

merged 3 commits into from Apr 27, 2022

Conversation

ghost
Copy link

@ghost ghost commented Apr 26, 2022

Fixes #6162

Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NACK - Still broken when switching back to not use a custom account name

Bildschirmfoto 2022-04-26 um 11 00 07

Apr.-26 11:00:03.709 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Uncaught Exception from thread JavaFX Application Thread 
Apr.-26 11:00:03.709 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableMessage= Cannot invoke "bisq.desktop.components.InputTextField.getText()" because "this.bankIdInputTextField" is null 
Apr.-26 11:00:03.709 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableClass= class java.lang.NullPointerException 
Apr.-26 11:00:03.709 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Stack trace:
java.lang.NullPointerException: Cannot invoke "bisq.desktop.components.InputTextField.getText()" because "this.bankIdInputTextField" is null
	at bisq.desktop.components.paymentmethods.GeneralBankForm.autoFillAccountTextFields(GeneralBankForm.java:145)
	at bisq.desktop.components.paymentmethods.BankForm.autoFillNameTextField(BankForm.java:401)
	at bisq.desktop.components.paymentmethods.PaymentMethodForm.lambda$addAccountNameTextFieldWithAutoFillToggleButton$2(PaymentMethodForm.java:144)

@ripcurlx ripcurlx added this to the v1.9.0 milestone Apr 26, 2022
@ghost ghost requested a review from ripcurlx April 26, 2022 10:31
Comment on lines 141 to 150


BankAccountPayload bankAccountPayload = null;
CashDepositAccountPayload cashDepositAccountPayload = null;
if (paymentAccountPayload instanceof BankAccountPayload) {
bankAccountPayload = (BankAccountPayload) paymentAccountPayload;
} else if (paymentAccountPayload instanceof CashDepositAccountPayload) {
cashDepositAccountPayload = (CashDepositAccountPayload) paymentAccountPayload;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like it so much having those checks in the abstract class for specific implementations. I think it would be better to have a getBankId, getBranchId, getBankName and getAccountNr implementation in the CashDeposit and BankAccount forms WDYT?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest commit.

Code could be even more simplified when CashDepositAccountPayload extends BankAccountPayload - do you see any obstacles from doing it (in this pull request)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think - let's keep it to a minimum for now. I'll test it now.

@ghost ghost changed the title Fix NPE when editing same bank account name Fix problems with editing account names Apr 26, 2022
@ghost ghost requested a review from ripcurlx April 26, 2022 11:58
@ripcurlx ripcurlx merged commit b4506ac into bisq-network:master Apr 27, 2022
@ghost ghost mentioned this pull request May 11, 2022
@ghost ghost mentioned this pull request Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v1.9.0] Trying to change account name of same bank account fails with Nullpointer exception
1 participant