Commit 7e18d3b6 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/modjni: new_jobject(): Handle null reference.

parent 9d5e5c08
......@@ -217,7 +217,9 @@ STATIC const mp_obj_type_t jobject_type = {
};
STATIC mp_obj_t new_jobject(jobject jo) {
if (JJ(IsInstanceOf, jo, String_class)) {
if (jo == NULL) {
return mp_const_none;
} else if (JJ(IsInstanceOf, jo, String_class)) {
const char *s = JJ(GetStringUTFChars, jo, NULL);
mp_obj_t ret = mp_obj_new_str(s, strlen(s), false);
JJ(ReleaseStringUTFChars, jo, s);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment