X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fpython%2Fnotmuch%2Fmessage.py;fp=bindings%2Fpython%2Fnotmuch%2Fmessage.py;h=6e32b5f7ada2d825d4cd6c23403f6b6b1271691f;hp=de0fb4151e52e50c3f3eb684932b65820d74cf82;hb=872bd134e3ba860236661a202965a3d7447e7af7;hpb=adde6dfaef9348a6ea5e1fe3651e85dacff775b7 diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py index de0fb415..6e32b5f7 100644 --- a/bindings/python/notmuch/message.py +++ b/bindings/python/notmuch/message.py @@ -482,7 +482,9 @@ class Message(Python3StringMixIn): if status != 0: raise NotmuchError(status) - return value.value.decode('utf-8') if value is not None else None + if value is None or value.value is None: + return None + return value.value.decode('utf-8') def get_properties(self, prop="", exact=False): """ Get the properties of the message, returning a generator of