From d6a0763b1d3eafd4bb8a54b142b1cc7c48cabd80 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sat, 12 Sep 2020 19:31:49 +0300 Subject: [PATCH] Teach Python bindings to process (char *)0 --- python/src/deltachat/cutil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/src/deltachat/cutil.py b/python/src/deltachat/cutil.py index 2b9aa7a0f..b230276b9 100644 --- a/python/src/deltachat/cutil.py +++ b/python/src/deltachat/cutil.py @@ -17,7 +17,8 @@ def iter_array(dc_array_t, constructor): def from_dc_charpointer(obj): - return ffi.string(ffi.gc(obj, lib.dc_str_unref)).decode("utf8") + if obj != ffi.NULL: + return ffi.string(ffi.gc(obj, lib.dc_str_unref)).decode("utf8") class DCLot: