Skip to content

Commit 0a88ccf

Browse files
committed
Avoid exceptions when printing a Bytes instance that has value None.
1 parent e0bf40b commit 0a88ccf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kafka/protocol/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def decode(cls, data):
100100

101101
@classmethod
102102
def repr(cls, value):
103-
return repr(value[:100] + b'...' if len(value) > 100 else b'')
103+
return repr(value[:100] + b'...' if value is not None and len(value) > 100 else b'')
104104

105105

106106
class Boolean(AbstractType):

0 commit comments

Comments
 (0)