mirror of https://github.com/apache/cloudstack.git
storage: Fixed null pointer (#4130)
Fixes #4090 When trying to migrate a VM across 2 clusters, if a snapshot has been deleted and garbage collection has run to update the removed field, it is not possible to migrate the instance due to a null pointer.
This commit is contained in:
parent
8b234bd14f
commit
6a683dcf77
|
|
@ -73,6 +73,9 @@ public class SnapshotDataFactoryImpl implements SnapshotDataFactory {
|
|||
for (SnapshotDataStoreVO snapshotDataStoreVO : allSnapshotsFromVolumeAndDataStore) {
|
||||
DataStore store = storeMgr.getDataStore(snapshotDataStoreVO.getDataStoreId(), role);
|
||||
SnapshotVO snapshot = snapshotDao.findById(snapshotDataStoreVO.getSnapshotId());
|
||||
if (snapshot == null){ //snapshot may have been removed;
|
||||
continue;
|
||||
}
|
||||
SnapshotObject info = SnapshotObject.getSnapshotObject(snapshot, store);
|
||||
|
||||
infos.add(info);
|
||||
|
|
|
|||
Loading…
Reference in New Issue