Prevent no caption in an image from crashing transwhat
This commit is contained in:
parent
1c0ae79ec2
commit
dbb66e0381
|
@ -318,6 +318,8 @@ class Session(YowsupApp):
|
||||||
def onImage(self, image):
|
def onImage(self, image):
|
||||||
self.logger.debug('Received image message %s', str(image))
|
self.logger.debug('Received image message %s', str(image))
|
||||||
buddy = image._from.split('@')[0]
|
buddy = image._from.split('@')[0]
|
||||||
|
if image.caption is None:
|
||||||
|
image.caption = ''
|
||||||
message = image.url + ' ' + image.caption
|
message = image.url + ' ' + image.caption
|
||||||
self.sendMessageToXMPP(buddy, message, image.timestamp)
|
self.sendMessageToXMPP(buddy, message, image.timestamp)
|
||||||
self.sendReceipt(image._id, image._from, None, image.participant)
|
self.sendReceipt(image._id, image._from, None, image.participant)
|
||||||
|
|
Loading…
Reference in a new issue