Skip to content

Commit 35850b2

Browse files
committed
one new type error
1 parent 9744e2e commit 35850b2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/confluent_kafka/deserializing_consumer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ def poll(self, timeout: float = -1) -> Optional[Message]:
106106
if error is not None:
107107
raise ConsumeError(error, kafka_message=msg)
108108

109-
ctx = SerializationContext(msg.topic(), MessageField.VALUE, msg.headers())
109+
topic = msg.topic()
110+
if topic is None:
111+
raise TypeError("Message topic is None")
112+
ctx = SerializationContext(topic, MessageField.VALUE, msg.headers())
113+
110114
value = msg.value()
111115
if self._value_deserializer is not None:
112116
try:

0 commit comments

Comments
 (0)