From 7713b4a3eb2e1e1e2b30727cfd114c76a779c217 Mon Sep 17 00:00:00 2001 From: Hellblazer Date: Sat, 25 May 2024 12:32:07 -0700 Subject: [PATCH] fix npe when no member found --- choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java b/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java index 242f46e96..62ded0daa 100644 --- a/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java +++ b/choam/src/main/java/com/salesforce/apollo/choam/CHOAM.java @@ -109,9 +109,8 @@ public CHOAM(Parameters params) { rotateViewKeys(); var bContext = new DelegatedContext<>(params.context()); - var adapter = new MessageAdapter(_ -> true, this::signatureHash, - _ -> Collections.emptyList(), - (_, any) -> any, AgedMessageOrBuilder::getContent); + var adapter = new MessageAdapter(_ -> true, this::signatureHash, _ -> Collections.emptyList(), (_, any) -> any, + AgedMessageOrBuilder::getContent); combine = new ReliableBroadcaster(bContext, params.member(), params.combine(), params.communications(), params.metrics() == null ? null : params.metrics().getCombineMetrics(), @@ -235,6 +234,7 @@ public static Block reconfigure(Digest nextViewId, Map joins, Hash public static Map rosterMap(Context baseContext, Collection members) { return members.stream() .map(baseContext::getMember) + .filter(m -> m != null) .collect(Collectors.toMap(Member::getId, Function.identity())); }