Skip to content

Commit 3c445db

Browse files
committed
Null-check entity before observation collection
1 parent 770f657 commit 3c445db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ public void add(Message message, ConfirmationHandler confirmationHandler) {
7575

7676
AccumulatedEntity get() {
7777
AccumulatedEntity entity = this.messages.poll();
78-
this.observationCollector.published(
79-
entity.observationContext(), entity.confirmationCallback().message());
78+
if (entity != null) {
79+
this.observationCollector.published(
80+
entity.observationContext(), entity.confirmationCallback().message());
81+
}
8082
return entity;
8183
}
8284

0 commit comments

Comments
 (0)