Skip to content

Commit ea3fb82

Browse files
committed
engine/storage: add NPE check, break if parent snapshot is null
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> (cherry picked from commit c06ca09) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent a52bbfb commit ea3fb82

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎engine/storage/src/org/apache/cloudstack/storage/helper/VMSnapshotHelperImpl.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ public VMSnapshotTO getSnapshotWithParents(VMSnapshotVO snapshot) {
138138
VMSnapshotVO current = snapshot;
139139
while (current.getParent() != null) {
140140
VMSnapshotVO parent = snapshotMap.get(current.getParent());
141+
if (parent == null) {
142+
break;
143+
}
141144
currentTO.setParent(convert2VMSnapshotTO(parent));
142145
current = snapshotMap.get(current.getParent());
143146
currentTO = currentTO.getParent();

0 commit comments

Comments
 (0)