nvazquez commented on a change in pull request #3566: server: fix NPE for the 
case where volume is not attached to a VM
URL: https://github.com/apache/cloudstack/pull/3566#discussion_r316180151
 
 

 ##########
 File path: server/src/main/java/com/cloud/server/ManagementServerImpl.java
 ##########
 @@ -1442,7 +1442,11 @@ private boolean hasSuitablePoolsForVolume(final 
VolumeVO volume, final Host host
         StoragePool srcVolumePool = _poolDao.findById(volume.getPoolId());
         allPools = 
getAllStoragePoolCompatileWithVolumeSourceStoragePool(srcVolumePool);
         allPools.remove(srcVolumePool);
-        suitablePools = findAllSuitableStoragePoolsForVm(volume, vm, 
srcVolumePool);
+        if (vm != null) {
 
 Review comment:
   One liner improvement if you have some time: `suitablePools = vm == null ? 
allPools : findAllSuitableStoragePools(....)`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to