mirror of https://github.com/apache/cloudstack.git
ApiResponseHelper: fix NPE when parent of snapshot is null
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
7c41a1184c
commit
fae4fdae53
|
|
@ -548,8 +548,10 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
}
|
||||
if (vmSnapshot.getParent() != null) {
|
||||
VMSnapshot vmSnapshotParent = ApiDBUtils.getVMSnapshotById(vmSnapshot.getParent());
|
||||
vmSnapshotResponse.setParent(vmSnapshotParent.getUuid());
|
||||
vmSnapshotResponse.setParentName(vmSnapshotParent.getDisplayName());
|
||||
if (vmSnapshotParent != null) {
|
||||
vmSnapshotResponse.setParent(vmSnapshotParent.getUuid());
|
||||
vmSnapshotResponse.setParentName(vmSnapshotParent.getDisplayName());
|
||||
}
|
||||
}
|
||||
vmSnapshotResponse.setCurrent(vmSnapshot.getCurrent());
|
||||
vmSnapshotResponse.setType(vmSnapshot.getType().toString());
|
||||
|
|
|
|||
Loading…
Reference in New Issue