Skip to content

Commit

Permalink
Merge pull request googleapis#44 from sampellino/patch-1
Browse files Browse the repository at this point in the history
Add try/except for JSON body key

Thanks!
  • Loading branch information
Narcolapser committed Nov 8, 2016
2 parents 3b4dd7d + 1f701d2 commit 0a5adea
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions O365/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,15 @@ def setBodyHTML(self,val=None):
val -- Default: None. The content of the body you want set. If you don't pass a
value it is just ignored.
'''
self.json['Body']['ContentType'] = 'HTML'
if val:
self.json['Body']['Content'] = val

cont = False

while not cont:
try:
self.json['Body']['ContentType'] = 'HTML'
if val:
self.json['Body']['Content'] = val
cont = True
except:
self.json['Body'] = {}

#To the King!

0 comments on commit 0a5adea

Please sign in to comment.