python: assert that underlying dc_msg_t* for Message is not NULL

This commit is contained in:
Dmitry Bogatov
2019-08-04 09:17:54 +00:00
parent d814dffbb0
commit 47b76ceb3e

View File

@@ -20,6 +20,7 @@ class Message(object):
self._dc_context = account._dc_context
assert isinstance(self._dc_context, ffi.CData)
assert isinstance(dc_msg, ffi.CData)
assert dc_msg != ffi.NULL
self._dc_msg = dc_msg
self.id = lib.dc_msg_get_id(dc_msg)
assert self.id is not None and self.id >= 0, repr(self.id)