fixing get job statuses issue

Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a0c9be8e
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a0c9be8e
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a0c9be8e

Branch: refs/heads/lahiru/AIRAVATA-2065
Commit: a0c9be8e2221b58ba995d81ef83abcab3414d407
Parents: 12383cc
Author: scnakandala <supun.nakand...@gmail.com>
Authored: Wed Sep 7 15:50:03 2016 -0400
Committer: scnakandala <supun.nakand...@gmail.com>
Committed: Wed Sep 7 15:50:03 2016 -0400

----------------------------------------------------------------------
 .../registry/api/service/handler/RegistryServerHandler.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/a0c9be8e/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
----------------------------------------------------------------------
diff --git 
a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
 
b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index 30c518f..3ca024c 100644
--- 
a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ 
b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -721,9 +721,9 @@ public class RegistryServerHandler implements 
RegistryService.Iface {
                                 for (Object jobObject : jobs) {
                                     JobModel jobModel = (JobModel) jobObject;
                                     String jobID = jobModel.getJobId();
-                                    JobStatus status = 
jobModel.getJobStatuses().get(0);
-                                    if (status != null){
-                                        jobStatus.put(jobID, status);
+                                    List<JobStatus> status = 
jobModel.getJobStatuses();
+                                    if (status != null && status.size()>0){
+                                        jobStatus.put(jobID, status.get(0));
                                     }
                                 }
                             }

Reply via email to