Merge pull request #289 from KAction/new-assert

python: assert that underlying dc_msg_t* for Message is not NULL
This commit is contained in:
Alexander Krotov
2019-08-04 12:58:04 +00:00
committed by GitHub

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)