Skip to content

Commit

Permalink
Merge pull request #7379 from alvasw/AltCoinAccountsDataModel_Handle_…
Browse files Browse the repository at this point in the history
…XMR_detection_NullPointerException

AltCoinAccountsDataModel: Handle XMR detection NullPointerException
  • Loading branch information
alejandrogarcia83 authored Feb 5, 2025
2 parents b8fcb90 + 9398513 commit 54b094f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected void activate() {
fillAndSortPaymentAccounts();

paymentAccounts.stream()
.filter(e -> e.getSingleTradeCurrency().getCode().equals("XMR"))
.filter(this::isXmrPaymentAccount)
.forEach(e -> {
if (!xmrAccountUsesSubAddresses(e)) {
XmrForm.showXmrSubAddressPopup();
Expand All @@ -98,6 +98,11 @@ private void fillAndSortPaymentAccounts() {
}
}

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;
Expand Down

0 comments on commit 54b094f

Please sign in to comment.