From 8f4c16da270b85af87f38773ffe976c6bc086dda Mon Sep 17 00:00:00 2001 From: Nathaniel Graham Date: Mon, 10 Aug 2015 15:54:36 -0600 Subject: [PATCH] Java null handle bugfix A helper method in Request.java could cause a crash if the request array that was passed contained nulls. Signed-off-by: Nathaniel Graham --- ompi/mpi/java/java/Request.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ompi/mpi/java/java/Request.java b/ompi/mpi/java/java/Request.java index fe5131e9bf..8c8bce9800 100644 --- a/ompi/mpi/java/java/Request.java +++ b/ompi/mpi/java/java/Request.java @@ -471,8 +471,12 @@ public class Request implements Freeable { long[] h = new long[r.length]; - for(int i = 0; i < r.length; i++) - h[i] = r[i].handle; + for(int i = 0; i < r.length; i++) { + if(r[i] != null) + h[i] = r[i].handle; + else + h[i] = 0; + } return h; }