server: fix NPE case in VolumeApiServiceImpl

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit df934c954106a618f8b0aca7e7dfbac890d78244)
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 48ef7e5f28
commit a07497b373

View File

@ -1650,12 +1650,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;
}
}