Fix crash while check jni

Signed-off-by: Kevin Liu <airk908@gmail.com>