Skip to content

Commit 07144ee

Browse files
authored
Merge pull request #1143 from B-Kingston/fix/handle-none-values
FIX: Handles private events with missing properties
2 parents 553d24e + 2ed9184 commit 07144ee

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

O365/calendar.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,9 @@ def __init__(self, parent, response_status):
549549
super().__init__(protocol=parent.protocol,
550550
main_resource=parent.main_resource)
551551
#: The status of the response |br| **Type:** str
552-
self.status = response_status.get(self._cc('response'), 'none')
552+
self.status = (response_status or {}).get(
553+
self._cc("response"), "none"
554+
) # Deals with private events with None response_status's
553555
self.status = None if self.status == 'none' else EventResponse.from_value(self.status)
554556
if self.status:
555557
#: The time the response was received |br| **Type:** datetime
@@ -871,7 +873,9 @@ def __init__(self, *, parent=None, con=None, **kwargs):
871873
self.object_id = cloud_data.get(cc('id'), None)
872874
self.__subject = cloud_data.get(cc('subject'),
873875
kwargs.get('subject', '') or '')
874-
body = cloud_data.get(cc('body'), {})
876+
body = (
877+
cloud_data.get(cc("body"), {}) or {}
878+
) # Deals with private events with None body's
875879
self.__body = body.get(cc('content'), '')
876880
#: The type of the content. Possible values are text and html. |br| **Type:** bodyType
877881
self.body_type = body.get(cc('contentType'),

0 commit comments

Comments
 (0)