airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: fixing NPE s in job status method
Date Tue, 01 Dec 2015 20:52:20 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 766433652 -> fbc558ddc


fixing NPE s in job status method


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

Branch: refs/heads/master
Commit: fbc558ddc4ecce57833fdaff9062f264a631e2ad
Parents: 7664336
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Tue Dec 1 15:52:14 2015 -0500
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Tue Dec 1 15:52:14 2015 -0500

----------------------------------------------------------------------
 .../api/server/handler/AiravataServerHandler.java       | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/fbc558dd/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index e88d4f8..40d0758 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -1637,9 +1637,15 @@ public class AiravataServerHandler implements Airavata.Iface {
                       for (TaskModel task : tasks){
                           String taskId =  task.getTaskId();
                           List<Object> jobs = experimentCatalog.get(ExperimentCatalogModelType.JOB,
Constants.FieldConstants.JobConstants.TASK_ID, taskId);
-                          for (Object jobObject : jobs) {
-                              String jobID = ((JobModel)jobObject).getJobId();
-                              jobStatus.put(jobID, ((JobModel)jobObject).getJobStatus());
+                          if (jobs != null && !jobs.isEmpty()){
+                              for (Object jobObject : jobs) {
+                                  JobModel jobModel = (JobModel) jobObject;
+                                  String jobID = jobModel.getJobId();
+                                  JobStatus status = jobModel.getJobStatus();
+                                  if (status != null){
+                                      jobStatus.put(jobID, status);
+                                  }
+                              }
                           }
                       }
                     }


Mime
View raw message