fix npe in offer payment account selection

This commit is contained in:
woodser 2023-05-20 10:00:22 -04:00
parent 5aba26ff82
commit 02eb2fb005

View File

@ -255,10 +255,10 @@ public abstract class MutableOfferDataModel extends OfferDataModel {
@NotNull
private Optional<PaymentAccount> 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();
}