Fix BytesGenerator._handle_text() if the message has no payload (None)
This commit is contained in:
parent
0c4cc559cb
commit
3a7ee3ab5a
|
@ -377,8 +377,11 @@ class BytesGenerator(Generator):
|
|||
def _handle_text(self, msg):
|
||||
# If the string has surrogates the original source was bytes, so
|
||||
# just write it back out.
|
||||
if _has_surrogates(msg._payload):
|
||||
self.write(msg._payload)
|
||||
payload = msg.get_payload()
|
||||
if payload is None:
|
||||
return
|
||||
if _has_surrogates(payload):
|
||||
self.write(payload)
|
||||
else:
|
||||
super(BytesGenerator,self)._handle_text(msg)
|
||||
|
||||
|
|
Loading…
Reference in New Issue