We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d5e5c0 commit 7e18d3bCopy full SHA for 7e18d3b
1 file changed
unix/modjni.c
@@ -217,7 +217,9 @@ STATIC const mp_obj_type_t jobject_type = {
217
};
218
219
STATIC mp_obj_t new_jobject(jobject jo) {
220
- if (JJ(IsInstanceOf, jo, String_class)) {
+ if (jo == NULL) {
221
+ return mp_const_none;
222
+ } else if (JJ(IsInstanceOf, jo, String_class)) {
223
const char *s = JJ(GetStringUTFChars, jo, NULL);
224
mp_obj_t ret = mp_obj_new_str(s, strlen(s), false);
225
JJ(ReleaseStringUTFChars, jo, s);
0 commit comments