Skip to content

Commit

Permalink
Merge pull request #234 from espes/import-crash
Browse files Browse the repository at this point in the history
check exceptions in find_javaclass
  • Loading branch information
tito committed Aug 22, 2017
2 parents 406dd20 + 27a4a85 commit 72be57a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jnius/jnius_export_func.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ def find_javaclass(namestr):

jc = j_env[0].FindClass(j_env, name)
if jc == NULL:
j_env[0].ExceptionClear(j_env)
raise JavaException('Class not found {0!r}'.format(name))

check_exception(j_env)

cls = Class(noinstance=True)
cls.instanciate_from(create_local_ref(j_env, jc))
j_env[0].DeleteLocalRef(j_env, jc)
Expand Down

0 comments on commit 72be57a

Please sign in to comment.