X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bc436d65d9cca17916fe60d8f3bc6c052541699c..aa50ff55316bcb56c40be9320534608e1eb8a4d0:/src/jmsg_task.c diff --git a/src/jmsg_task.c b/src/jmsg_task.c index 72a6480642..cf6962fb5e 100644 --- a/src/jmsg_task.c +++ b/src/jmsg_task.c @@ -247,6 +247,10 @@ Java_org_simgrid_msg_Task_getSender(JNIEnv * env, } process = MSG_task_get_sender(task); + if (process == NULL) { + jxbt_throw_illegal(env,bprintf("Tried to get the sender of a task that hasn't been sent yet.")); + return NULL; + } return (jobject) native_to_java_process(process); } @@ -263,7 +267,10 @@ Java_org_simgrid_msg_Task_getSource(JNIEnv * env, } host = MSG_task_get_source(task); - + if (host == NULL) { + jxbt_throw_illegal(env,bprintf("Tried to get the source of a task that hasn't been sent yet.")); + return NULL; + } if (!MSG_host_get_data(host)) { jxbt_throw_jni(env, "MSG_task_get_source() failed"); return NULL;