You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/02/05 12:51:57 UTC
[21/22] git commit: updated refs/heads/4.5 to 78b9be0
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 <ro...@shapeblue.com>
Authored: Thu Feb 5 17:02:30 2015 +0530
Committer: Rohit Yadav <ro...@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());