From cb10a65a832c629ffc570324fcf2a628181a3f35 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 17 Aug 2022 10:54:47 -0400 Subject: [PATCH] fix npe in arbitrator when dispute is opened --- .../main/java/bisq/core/trade/protocol/TradeProtocol.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java b/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java index 56ae9a844f..d95b045993 100644 --- a/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java +++ b/core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java @@ -584,14 +584,14 @@ public abstract class TradeProtocol implements DecryptedDirectMessageListener, D private boolean isPubKeyValid(DecryptedMessageWithPubKey message, NodeAddress sender) { + // valid if arbitrator's pub key ring + if (trade.getArbitratorPubKeyRing() != null && message.getSignaturePubKey().equals(trade.getArbitratorPubKeyRing().getSignaturePubKey())) return true; + // not invalid if pub key rings are unknown if (trade.getTradingPeer().getPubKeyRing() == null && trade.getArbitratorPubKeyRing() == null) return true; // valid if peer's pub key ring - if (trade.getTradingPeer().getPubKeyRing() != null && message.getSignaturePubKey().equals(trade.getTradingPeer().getPubKeyRing().getSignaturePubKey())) return true; - - // valid if arbitrator's pub key ring - if (trade.getArbitratorPubKeyRing() != null && message.getSignaturePubKey().equals(trade.getArbitratorPubKeyRing().getSignaturePubKey())) return true; + if (trade.getTradingPeer() != null && trade.getTradingPeer().getPubKeyRing() != null && message.getSignaturePubKey().equals(trade.getTradingPeer().getPubKeyRing().getSignaturePubKey())) return true; // invalid log.error("SignaturePubKey in message does not match the SignaturePubKey we have set for our trading peer and arbitrator.");