summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--unix/modffi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/unix/modffi.c b/unix/modffi.c
index 7c87e5b01a..6e0f06ec77 100644
--- a/unix/modffi.c
+++ b/unix/modffi.c
@@ -140,6 +140,9 @@ STATIC mp_obj_t return_ffi_value(ffi_arg val, char type)
switch (type) {
case 's': {
const char *s = (const char *)val;
+ if (!s) {
+ return mp_const_none;
+ }
return mp_obj_new_str(s, strlen(s), false);
}
case 'v':