server: fix NPE case in VolumeApiServiceImpl

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2015-04-13 15:33:23 +05:30
parent d2471df0be
commit df934c9541
1 changed files with 2 additions and 2 deletions

View File

@ -1636,12 +1636,12 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
}
HostVO host = null;
StoragePoolVO volumePool = _storagePoolDao.findById(volume.getPoolId());
StoragePoolVO volumePool = _storagePoolDao.findByIdIncludingRemoved(volume.getPoolId());
if (hostId != null) {
host = _hostDao.findById(hostId);
if (host != null && host.getHypervisorType() == HypervisorType.XenServer && volumePool.isManaged()) {
if (host != null && host.getHypervisorType() == HypervisorType.XenServer && volumePool != null && volumePool.isManaged()) {
sendCommand = true;
}
}