airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [2/2] airavata git commit: fixing NPE
Date Tue, 11 Nov 2014 22:09:23 GMT
fixing NPE


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

Branch: refs/heads/master
Commit: 831dbdce4a9f4874fe0198d72013f6251adbbb47
Parents: c36ab24
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Tue Nov 11 17:08:56 2014 -0500
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Tue Nov 11 17:08:56 2014 -0500

----------------------------------------------------------------------
 .../catalog/data/util/AppCatalogThriftConversion.java        | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/831dbdce/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
index 35549f4..00d271d 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/util/AppCatalogThriftConversion.java
@@ -670,8 +670,12 @@ public class AppCatalogThriftConversion {
         ComputeResourcePreference preference = new ComputeResourcePreference();
         preference.setComputeResourceId(resource.getResourceId());
         preference.setOverridebyAiravata(resource.getOverrideByAiravata());
-        preference.setPreferredJobSubmissionProtocol(JobSubmissionProtocol.valueOf(resource.getPreferredJobProtocol()));
-        preference.setPreferredDataMovementProtocol(DataMovementProtocol.valueOf(resource.getPreferedDMProtocol()));
+        if (resource.getPreferredJobProtocol() != null){
+            preference.setPreferredJobSubmissionProtocol(JobSubmissionProtocol.valueOf(resource.getPreferredJobProtocol()));
+        }
+        if (resource.getPreferedDMProtocol() != null){
+            preference.setPreferredDataMovementProtocol(DataMovementProtocol.valueOf(resource.getPreferedDMProtocol()));
+        }
         preference.setPreferredBatchQueue(resource.getBatchQueue());
         preference.setScratchLocation(resource.getScratchLocation());
         preference.setAllocationProjectNumber(resource.getProjectNumber());


Mime
View raw message