diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-14 00:24:36 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-14 00:25:10 +0300 |
commit | 41eb705477bd9f988e201c71cf1cde3836137e4e (patch) | |
tree | 16d032760f6b26814d350810b3f524d7276f8ca3 | |
parent | 2ec835f572cdee78c6c1ffd300bd159e0e35598a (diff) | |
download | micropython-41eb705477bd9f988e201c71cf1cde3836137e4e.tar.gz micropython-41eb705477bd9f988e201c71cf1cde3836137e4e.zip |
unix/modjni: call_method: Check for Java exception after method return.
-rw-r--r-- | unix/modjni.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unix/modjni.c b/unix/modjni.c index 3946232615..ef416ee48e 100644 --- a/unix/modjni.c +++ b/unix/modjni.c @@ -450,15 +450,19 @@ STATIC mp_obj_t call_method(jobject obj, const char *name, jarray methods, bool } else { if (MATCH(ret_type, "void")) { JJ(CallVoidMethodA, obj, method_id, jargs); + check_exception(); ret = mp_const_none; } else if (MATCH(ret_type, "int")) { jint res = JJ(CallIntMethodA, obj, method_id, jargs); + check_exception(); ret = mp_obj_new_int(res); } else if (MATCH(ret_type, "boolean")) { jboolean res = JJ(CallBooleanMethodA, obj, method_id, jargs); + check_exception(); ret = mp_obj_new_bool(res); } else if (is_object_type(ret_type)) { res = JJ(CallObjectMethodA, obj, method_id, jargs); + check_exception(); ret = new_jobject(res); } else { JJ(ReleaseStringUTFChars, name_o, decl); |