mirror of https://github.com/apache/cloudstack.git
ApiResponseHelper: fix NPE when parent of snapshot is null
This commit is contained in:
parent
ca0a77088c
commit
1cf165f86d
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue