Skip to content

Commit 63fcfec

Browse files
committed
on_commit: handle NULL offsets list (on error)
1 parent b85afd5 commit 63fcfec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

confluent_kafka/src/Consumer.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,10 @@ static void Consumer_offset_commit_cb (rd_kafka_t *rk, rd_kafka_resp_err_t err,
676676
k_err = KafkaError_new_or_None(err, NULL);
677677

678678
/* Construct list of TopicPartition based on 'c_parts' */
679-
parts = c_parts_to_py(c_parts);
679+
if (c_parts)
680+
parts = c_parts_to_py(c_parts);
681+
else
682+
parts = PyList_New(0);
680683

681684
args = Py_BuildValue("(OO)", k_err, parts);
682685

0 commit comments

Comments
 (0)