Skip to content

Commit 03f1461

Browse files
garyrussellartembilan
authored andcommitted
GH-1145: Backport NPE Fix
Resolves #1145 **cherry-pick to 2.0.x, 1.3.x**
1 parent 55a3fd5 commit 03f1461

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
@@ -566,7 +566,10 @@ else if (KafkaMessageListenerContainer.this.getContainerProperties().isSyncCommi
566566
};
567567
}
568568

569-
private void seekPartitions(Collection<TopicPartition> partitions, boolean idle) {
569+
private void seekPartitions(@Nullable Collection<TopicPartition> partitions, boolean idle) {
570+
if (partitions == null) {
571+
return;
572+
}
570573
Map<TopicPartition, Long> current = new HashMap<>();
571574
for (TopicPartition topicPartition : partitions) {
572575
current.put(topicPartition, ListenerConsumer.this.consumer.position(topicPartition));

0 commit comments

Comments
 (0)