Skip to content

Commit f1de729

Browse files
authored
Merge pull request mfontanini#234 from accelerated/null_topic
Fix crash when message handle is valid but topic is null
2 parents c3b4580 + 81ce56a commit f1de729

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)