Skip to content

Commit 15ab184

Browse files
garyrussellartembilan
authored andcommitted
GH-1145: Backport NPE Fix
Resolves #1145 **cherry-pick to 2.0.x, 1.3.x**
1 parent 1171c00 commit 15ab184

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,10 @@ else if (KafkaMessageListenerContainer.this.getContainerProperties().isSyncCommi
630630
};
631631
}
632632

633-
private void seekPartitions(Collection<TopicPartition> partitions, boolean idle) {
633+
private void seekPartitions(@Nullable Collection<TopicPartition> partitions, boolean idle) {
634+
if (partitions == null) {
635+
return;
636+
}
634637
Map<TopicPartition, Long> current = new HashMap<>();
635638
for (TopicPartition topicPartition : partitions) {
636639
current.put(topicPartition, ListenerConsumer.this.consumer.position(topicPartition));

0 commit comments

Comments
 (0)