Skip to content

Commit 181fb03

Browse files
committed
CLOUDSTACK-3716:NPE triggered in DownloadListener
1 parent 7974dfe commit 181fb03

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,11 @@ public void handleVolumeSync(DataStore store) {
10451045
List<VolumeDataStoreVO> toBeDownloaded = new ArrayList<VolumeDataStoreVO>(dbVolumes);
10461046
for (VolumeDataStoreVO volumeStore : dbVolumes) {
10471047
VolumeVO volume = _volumeDao.findById(volumeStore.getVolumeId());
1048+
if (volume == null ){
1049+
s_logger.warn("Volume_store_ref shows that volume " + volumeStore.getVolumeId() + " is on image store " + storeId
1050+
+ ", but the volume is not found in volumes table, potentially some bugs in deleteVolume, so we just treat this volume to be deleted");
1051+
continue;
1052+
}
10481053
// Exists then don't download
10491054
if (volumeInfos.containsKey(volume.getId())) {
10501055
TemplateProp volInfo = volumeInfos.remove(volume.getId());

0 commit comments

Comments
 (0)