Skip to content

Commit c784857

Browse files
return empty string for null pointers #51
1 parent 183cdd5 commit c784857

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyray/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def func(*args):
7777
if result is None:
7878
return
7979
if str(type(result)) == "<class '_cffi_backend._CDataBase'>" and str(result).startswith("<cdata 'char *'"):
80-
result = ffi.string(result).decode('utf-8')
80+
if str(result) == "<cdata 'char *' NULL>":
81+
result = ""
82+
else:
83+
result = ffi.string(result).decode('utf-8')
8184
return result
8285
return func
8386

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "4.0.0.1"
1+
__version__ = "4.0.0.2"

0 commit comments

Comments
 (0)