Fix potential NPE in persistence of Contract.

This commit is contained in:
yonson2023 2023-12-03 10:14:53 -06:00
parent bba7327115
commit c7f36b255b
No known key found for this signature in database
GPG key ID: 653F31AF4087E2F2

View file

@ -226,9 +226,10 @@ public final class Contract implements NetworkPayload {
.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)