engine/storage: add NPE check, break if parent snapshot is null

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit c06ca09b54)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2015-01-18 17:20:09 +05:30
parent fc5d8e95bf
commit dc97372d6f
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ public class VMSnapshotHelperImpl implements VMSnapshotHelper {
VMSnapshotVO current = snapshot;
while (current.getParent() != null) {
VMSnapshotVO parent = snapshotMap.get(current.getParent());
if (parent == null) {
break;
}
currentTO.setParent(convert2VMSnapshotTO(parent));
current = snapshotMap.get(current.getParent());
currentTO = currentTO.getParent();