[PATCH] python: fix unchecked None access in get_property

classic Classic list List threaded Threaded
2 messages Options
Vincent Breitmoser Vincent Breitmoser
Reply | Threaded
Open this post in threaded view
|

[PATCH] python: fix unchecked None access in get_property

---
 bindings/python/notmuch/message.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py
index d242097a..de0fb415 100644
--- a/bindings/python/notmuch/message.py
+++ b/bindings/python/notmuch/message.py
@@ -482,7 +482,7 @@ class Message(Python3StringMixIn):
         if status != 0:
             raise NotmuchError(status)
 
-        return value.value.decode('utf-8')
+        return value.value.decode('utf-8') if value is not None else None
 
     def get_properties(self, prop="", exact=False):
         """ Get the properties of the message, returning a generator of
--
2.18.0

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] python: fix unchecked None access in get_property

Vincent Breitmoser <[hidden email]> writes:

> ---
>  bindings/python/notmuch/message.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

pushed to master, thanks for the fix,

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch