Skip to content

Commit

Permalink
Merge pull request googleapis#299 from shyamdsundar/master
Browse files Browse the repository at this point in the history
Fix "keyerror" issue in beautifulsoup while checking attribute.
  • Loading branch information
Alejandro Casanovas authored Sep 2, 2019
2 parents 5280685 + 354d15e commit 8739a8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion O365/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def __init__(self, *, parent=None, con=None, **kwargs):
'HTML') # default to HTML for new messages
if self.has_attachments is False and self.body_type.upper() == 'HTML':
# test for inline attachments (Azure responds with hasAttachments=False when there are only inline attachments):
if any(img['src'].startswith('cid:') for img in self.get_body_soup().find_all('img')):
if any( img.get('src','').startswith('cid:') for img in self.get_body_soup().find_all('img')):
self.has_attachments = True

if self.has_attachments and download_attachments:
Expand Down

0 comments on commit 8739a8f

Please sign in to comment.