fixed NPE

(cherry picked from commit c78f14cbc2)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Anthony Xu 2014-10-29 17:05:42 -07:00 committed by Rohit Yadav
parent bf17f640c6
commit 98b416b7f0
1 changed files with 1 additions and 1 deletions

View File

@ -2107,7 +2107,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
_haMgr.cancelScheduledMigrations(host);
List<VMInstanceVO> vms = _haMgr.findTakenMigrationWork();
for (VMInstanceVO vm : vms) {
if (vm.getHostId() != null && vm.getHostId() == hostId) {
if (vm != null && vm.getHostId() != null && vm.getHostId() == hostId) {
s_logger.info("Unable to cancel migration because the vm is being migrated: " + vm);
return false;
}