Skip to content

Commit

Permalink
fix minor npe (hyperledger#5495)
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
  • Loading branch information
garyschulte authored May 25, 2023
1 parent 65bcc55 commit 128f95e
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -797,12 +797,14 @@ void execute() {
execute();
}));
} else {
final Map<PacketType, PeerInteractionState> peerInteractionStateMap =
inflightInteractions.get(peerId);
peerInteractionStateMap.remove(expectedType);
if (peerInteractionStateMap.isEmpty()) {
inflightInteractions.remove(peerId);
}
Optional.ofNullable(inflightInteractions.get(peerId))
.ifPresent(
peerInterationStateMap -> {
peerInterationStateMap.remove(expectedType);
if (peerInterationStateMap.isEmpty()) {
inflightInteractions.remove(peerId);
}
});
}
}

Expand Down

0 comments on commit 128f95e

Please sign in to comment.