cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [21/22] git commit: updated refs/heads/4.5 to 78b9be0
Date Thu, 05 Feb 2015 11:51:57 GMT
ApiResponseHelper: fix NPE when parent of snapshot is null


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

Branch: refs/heads/4.5
Commit: 1cf165f86df718bdbd1db1f094a341c8abaca42e
Parents: ca0a770
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Thu Feb 5 17:02:30 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Feb 5 17:10:56 2015 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1cf165f8/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index b8d4b3f..a13e996 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -500,7 +500,10 @@ public class ApiResponseHelper implements ResponseGenerator {
             vmSnapshotResponse.setVirtualMachineid(vm.getUuid());
         }
         if (vmSnapshot.getParent() != null) {
-            vmSnapshotResponse.setParentName(ApiDBUtils.getVMSnapshotById(vmSnapshot.getParent()).getDisplayName());
+            VMSnapshot vmSnapshotParent = ApiDBUtils.getVMSnapshotById(vmSnapshot.getParent());
+            if (vmSnapshotParent != null) {
+                vmSnapshotResponse.setParentName(vmSnapshotParent.getDisplayName());
+            }
         }
         vmSnapshotResponse.setCurrent(vmSnapshot.getCurrent());
         vmSnapshotResponse.setType(vmSnapshot.getType().toString());


Mime
View raw message