fixed NPE

This commit is contained in:
Anthony Xu 2014-10-29 17:05:42 -07:00
parent 9d5b7b73a2
commit c78f14cbc2
1 changed files with 1 additions and 1 deletions

View File

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