From 02eb2fb0054e0c8ea486f48a6d024fb2426fffdd Mon Sep 17 00:00:00 2001 From: woodser Date: Sat, 20 May 2023 10:00:22 -0400 Subject: [PATCH] fix npe in offer payment account selection --- .../haveno/desktop/main/offer/MutableOfferDataModel.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desktop/src/main/java/haveno/desktop/main/offer/MutableOfferDataModel.java b/desktop/src/main/java/haveno/desktop/main/offer/MutableOfferDataModel.java index 45bb7ea5e0..ff11f66b15 100644 --- a/desktop/src/main/java/haveno/desktop/main/offer/MutableOfferDataModel.java +++ b/desktop/src/main/java/haveno/desktop/main/offer/MutableOfferDataModel.java @@ -255,10 +255,10 @@ public abstract class MutableOfferDataModel extends OfferDataModel { @NotNull private Optional getAnyPaymentAccount() { - if (CurrencyUtil.isTraditionalCurrency(tradeCurrency.getCode())) { - return paymentAccounts.stream().filter(paymentAccount1 -> !paymentAccount1.getPaymentMethod().isCrypto()).findAny(); + if (CurrencyUtil.isFiatCurrency(tradeCurrency.getCode())) { + return paymentAccounts.stream().filter(paymentAccount1 -> paymentAccount1.isFiat()).findAny(); } else { - return paymentAccounts.stream().filter(paymentAccount1 -> paymentAccount1.getPaymentMethod().isCrypto() && + return paymentAccounts.stream().filter(paymentAccount1 -> !paymentAccount1.isFiat() && paymentAccount1.getTradeCurrency().isPresent() && !Objects.equals(paymentAccount1.getTradeCurrency().get().getCode(), GUIUtil.TOP_CRYPTO.getCode())).findAny(); }