mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-28 17:15:14 +01:00
AltCoinAccountsDataModel: Handle XMR detection NullPointerException
The PaymentAccount.getSingleTradeCurrency(...) method can return null in certain cases.
This commit is contained in:
parent
861f655ae7
commit
93985137a0
1 changed files with 6 additions and 1 deletions
|
@ -81,7 +81,7 @@ class AltCoinAccountsDataModel extends ActivatableDataModel {
|
|||
fillAndSortPaymentAccounts();
|
||||
|
||||
paymentAccounts.stream()
|
||||
.filter(e -> e.getSingleTradeCurrency().getCode().equals("XMR"))
|
||||
.filter(this::isXmrPaymentAccount)
|
||||
.forEach(e -> {
|
||||
if (!xmrAccountUsesSubAddresses(e)) {
|
||||
XmrForm.showXmrSubAddressPopup();
|
||||
|
@ -98,6 +98,11 @@ class AltCoinAccountsDataModel extends ActivatableDataModel {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean isXmrPaymentAccount(PaymentAccount paymentAccount) {
|
||||
TradeCurrency tradeCurrency = paymentAccount.getSingleTradeCurrency();
|
||||
return tradeCurrency != null && tradeCurrency.getCode().equals("XMR");
|
||||
}
|
||||
|
||||
private boolean xmrAccountUsesSubAddresses(PaymentAccount paymentAccount) {
|
||||
if (paymentAccount instanceof CryptoCurrencyAccount) {
|
||||
CryptoCurrencyAccount account = (CryptoCurrencyAccount) paymentAccount;
|
||||
|
|
Loading…
Add table
Reference in a new issue