Skip to content

Commit 41eb705

Browse files
committed
unix/modjni: call_method: Check for Java exception after method return.
1 parent 2ec835f commit 41eb705

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

unix/modjni.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,15 +450,19 @@ STATIC mp_obj_t call_method(jobject obj, const char *name, jarray methods, bool
450450
} else {
451451
if (MATCH(ret_type, "void")) {
452452
JJ(CallVoidMethodA, obj, method_id, jargs);
453+
check_exception();
453454
ret = mp_const_none;
454455
} else if (MATCH(ret_type, "int")) {
455456
jint res = JJ(CallIntMethodA, obj, method_id, jargs);
457+
check_exception();
456458
ret = mp_obj_new_int(res);
457459
} else if (MATCH(ret_type, "boolean")) {
458460
jboolean res = JJ(CallBooleanMethodA, obj, method_id, jargs);
461+
check_exception();
459462
ret = mp_obj_new_bool(res);
460463
} else if (is_object_type(ret_type)) {
461464
res = JJ(CallObjectMethodA, obj, method_id, jargs);
465+
check_exception();
462466
ret = new_jobject(res);
463467
} else {
464468
JJ(ReleaseStringUTFChars, name_o, decl);

0 commit comments

Comments
 (0)