diff --git a/Cargo.lock b/Cargo.lock index 679d3cbd5..906502328 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1123,7 +1123,7 @@ dependencies = [ [[package]] name = "rdkafka" -version = "0.27.0-alpha.0" +version = "0.27.0" dependencies = [ "async-std", "backoff", diff --git a/src/consumer/base_consumer.rs b/src/consumer/base_consumer.rs index 63e24c16d..df128e895 100644 --- a/src/consumer/base_consumer.rs +++ b/src/consumer/base_consumer.rs @@ -39,7 +39,11 @@ pub(crate) unsafe extern "C" fn native_commit_cb( } else { Ok(()) }; - let tpl = TopicPartitionList::from_ptr(offsets); + let tpl = if offsets.is_null() { + TopicPartitionList::new() + } else { + TopicPartitionList::from_ptr(offsets) + }; context.commit_callback(commit_error, &tpl); mem::forget(tpl); // Do not free offsets