mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-23 01:44:52 +01:00
python: fix Message.get_header
8dc8495010
introduced a bug, if the
requested header is not set the underlying notmuch function returns an
empty string that also made the expression true resulting in an
exception being raised. Partly revert the commit to fix this
issue. Testing for equality with None is correct in this case since
the restype of the function Message._get_header is c_char_p so NULL
pointers are in fact converted to None in this case.
Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
parent
8e3faa7f18
commit
8f667be2ac
1 changed files with 1 additions and 1 deletions
|
@ -229,7 +229,7 @@ class Message(Python3StringMixIn):
|
||||||
|
|
||||||
#Returns NULL if any error occurs.
|
#Returns NULL if any error occurs.
|
||||||
header = Message._get_header(self._msg, _str(header))
|
header = Message._get_header(self._msg, _str(header))
|
||||||
if not header:
|
if header == None:
|
||||||
raise NullPointerError()
|
raise NullPointerError()
|
||||||
return header.decode('UTF-8', 'ignore')
|
return header.decode('UTF-8', 'ignore')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue