From c7f36b255b46c1e79c98abbac8fdd52802c9987c Mon Sep 17 00:00:00 2001 From: yonson2023 <122909161+yonson2023@users.noreply.github.com> Date: Sun, 3 Dec 2023 10:14:53 -0600 Subject: [PATCH] Fix potential NPE in persistence of Contract. --- .../main/java/bisq/core/trade/model/bisq_v1/Contract.java | 5 +++-- 1 file changed, 3 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 5bf915c6f00..af0a7ad01a6 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 @@ -226,9 +226,10 @@ public protobuf.Contract toProtoMessage() { .setTakerPayoutAddressString(takerPayoutAddressString) .setMakerMultiSigPubKey(ByteString.copyFrom(makerMultiSigPubKey)) .setTakerMultiSigPubKey(ByteString.copyFrom(takerMultiSigPubKey)) - .setLockTime(lockTime) - .setRefundAgentNodeAddress(refundAgentNodeAddress.toProtoMessage()); + .setLockTime(lockTime); + Optional.ofNullable(refundAgentNodeAddress) // bisq/issues/6953 refundAgentNodeAddress sometimes is null + .ifPresent(e -> builder.setRefundAgentNodeAddress(refundAgentNodeAddress.toProtoMessage())); Optional.ofNullable(hashOfMakersPaymentAccountPayload) .ifPresent(e -> builder.setHashOfMakersPaymentAccountPayload(ByteString.copyFrom(hashOfMakersPaymentAccountPayload))); Optional.ofNullable(hashOfTakersPaymentAccountPayload)