diff --git a/O365/mailbox.py b/O365/mailbox.py index 9f7ce0950b86..cab2ec39fc7c 100644 --- a/O365/mailbox.py +++ b/O365/mailbox.py @@ -142,8 +142,8 @@ def get_message(self, object_id=None, query=None, *, download_attachments=False) :return: one Message :rtype: Message or None """ - if object_id is not None and query is not None: - raise ValueError('Must provide object id or query but not both.') + if object_id is None and query is None: + raise ValueError('Must provide object id or query.') if object_id is not None: url = self.build_url(self._endpoints.get('message').format(id=object_id))