airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Fixed NPE with reservataion start time and end time
Date Tue, 09 Aug 2016 17:58:08 GMT
Repository: airavata
Updated Branches:
  refs/heads/master a4716a7b3 -> 876a1405c


Fixed NPE with reservataion start time and end time


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

Branch: refs/heads/master
Commit: 876a1405c7998cd713c3360283c184640c672404
Parents: a4716a7
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Tue Aug 9 13:57:29 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Tue Aug 9 13:57:29 2016 -0400

----------------------------------------------------------------------
 .../core/app/catalog/util/AppCatalogThriftConversion.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/876a1405/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
index 4d73ac6..8b40d62 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/util/AppCatalogThriftConversion.java
@@ -834,8 +834,13 @@ public class AppCatalogThriftConversion {
         preference.setUsageReportingGatewayId(resource.getGatewayId());
         preference.setQualityOfService(resource.getQualityOfService());
         preference.setReservation(resource.getReservation());
-        preference.setReservationStartTime(resource.getReservationStartTime().getTime());
-        preference.setReservationEndTime(resource.getReservationEndTime().getTime());
+        if (resource.getReservationStartTime() != null) {
+            preference.setReservationStartTime(resource.getReservationStartTime().getTime());
+        }
+
+        if (resource.getReservationEndTime() != null) {
+            preference.setReservationEndTime(resource.getReservationEndTime().getTime());
+        }
         return preference;
     }
 


Mime
View raw message