Skip to content

Commit 81ce56a

Browse files
author
Alexander Damian
committed
Fix case when message handle is valid but topic is null
1 parent c3b4580 commit 81ce56a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/cppkafka/message.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class CPPKAFKA_API Message {
108108
*/
109109
std::string get_topic() const {
110110
assert(handle_);
111-
return rd_kafka_topic_name(handle_->rkt);
111+
return handle_->rkt ? rd_kafka_topic_name(handle_->rkt) : std::string{};
112112
}
113113

114114
/**

0 commit comments

Comments
 (0)