aboutsummaryrefslogtreecommitdiff
path: root/src/type_handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/type_handler.c')
-rw-r--r--src/type_handler.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/type_handler.c b/src/type_handler.c
index 0c7bc67..4c0bc37 100644
--- a/src/type_handler.c
+++ b/src/type_handler.c
@@ -44,6 +44,13 @@ int jatoms2atoms(JNIEnv *env, jobjectArray jatoms, int *nb_atoms, t_atom *atoms)
for(i=0;i<*nb_atoms;i++) {
obj = (*env)->GetObjectArrayElement(env, jatoms, i);
+ if ( obj == NULL ) {
+ jclass exception = (*env)->FindClass(env, "java/lang/NullPointerException");
+ ASSERT(exception);
+ (*env)->ThrowNew(env, exception, NULL);
+ (*env)->DeleteLocalRef(env, exception);
+ return 1;
+ }
rc |= jatom2atom(env, obj, atoms+i);
}