From f3dfc1477930a2ee333a8e0d81b836ed3fce6e9f Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Mon, 21 Feb 2022 10:59:32 -0600 Subject: [PATCH] Get payment method ID from offerPayload. Was getting an NPE with closed trades older than v1.7.0. makerPaymentMethodId was new at that point (null for older trades). makerPaymentAccountPayload can be null for trades where we have removed account info for privacy reasons (see #6001). The payment method ID can always be obtained from offerPayload. --- .../src/main/java/bisq/core/trade/model/bisq_v1/Contract.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/model/bisq_v1/Contract.java b/core/src/main/java/bisq/core/trade/model/bisq_v1/Contract.java index 4f939e36b2..b7d458e757 100644 --- a/core/src/main/java/bisq/core/trade/model/bisq_v1/Contract.java +++ b/core/src/main/java/bisq/core/trade/model/bisq_v1/Contract.java @@ -298,8 +298,8 @@ public final class Contract implements NetworkPayload { } public String getPaymentMethodId() { - // Either makerPaymentMethodId is set or available in makerPaymentAccountPayload - return makerPaymentMethodId != null ? makerPaymentMethodId : Objects.requireNonNull(makerPaymentAccountPayload).getPaymentMethodId(); + // Either makerPaymentMethodId is set or available in offerPayload + return makerPaymentMethodId != null ? makerPaymentMethodId : Objects.requireNonNull(getOfferPayload()).getPaymentMethodId(); } public Coin getTradeAmount() {