mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
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:
parent
48ef7e5f28
commit
a07497b373
@ -1650,12 +1650,12 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||||||
}
|
}
|
||||||
|
|
||||||
HostVO host = null;
|
HostVO host = null;
|
||||||
StoragePoolVO volumePool = _storagePoolDao.findById(volume.getPoolId());
|
StoragePoolVO volumePool = _storagePoolDao.findByIdIncludingRemoved(volume.getPoolId());
|
||||||
|
|
||||||
if (hostId != null) {
|
if (hostId != null) {
|
||||||
host = _hostDao.findById(hostId);
|
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;
|
sendCommand = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user