return empty string for null pointers https://github.com/electronstudio/raylib-python-cffi/issues/51
This commit is contained in:
parent
183cdd52c6
commit
c784857527
2 changed files with 5 additions and 2 deletions
|
@ -77,7 +77,10 @@ def makefunc(a):
|
|||
if result is None:
|
||||
return
|
||||
if str(type(result)) == "<class '_cffi_backend._CDataBase'>" and str(result).startswith("<cdata 'char *'"):
|
||||
result = ffi.string(result).decode('utf-8')
|
||||
if str(result) == "<cdata 'char *' NULL>":
|
||||
result = ""
|
||||
else:
|
||||
result = ffi.string(result).decode('utf-8')
|
||||
return result
|
||||
return func
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "4.0.0.1"
|
||||
__version__ = "4.0.0.2"
|
Reference in a new issue