hipchat: Skip attachments without paths.

This is a short term workaround.  Some variants
of HipChat exports are missing `path`, and we just
punt for now.
This commit is contained in:
Steve Howell 2018-11-13 23:52:17 +00:00 committed by Tim Abbott
parent 546fd5d60e
commit aff84cd1e9
1 changed files with 6 additions and 1 deletions

View File

@ -22,9 +22,14 @@ class AttachmentHandler:
if not attachment:
return None
name = attachment['name']
if 'path' not in attachment:
logging.info('Skipping HipChat attachment with missing path data: ' + name)
return None
size = attachment['size']
path = attachment['path']
name = attachment['name']
local_fn = os.path.join(files_dir, path)