Skip to content

Commit 53e207d

Browse files
committed
Strings: handle null values from the API as empty strings to match the current behavior with arrays.
1 parent 533f0dc commit 53e207d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

dss/_cffi_api_util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ def clear_buffers(self):
146146
self.init_buffers()
147147

148148
def get_string(self, b):
149-
return self.ffi.string(b).decode(self.codec)
149+
if b != self.ffi.NULL:
150+
return self.ffi.string(b).decode(self.codec)
151+
return ''
150152

151153
def get_float64_array(self, func, *args):
152154
ptr = self.ffi.new('double**')

0 commit comments

Comments
 (0)