You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2019/08/21 13:22:06 UTC

[GitHub] [cloudstack] nvazquez commented on a change in pull request #3566: server: fix NPE for the case where volume is not attached to a VM

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:
users@infra.apache.org


With regards,
Apache Git Services