Skip to content

Commit c78f14c

Browse files
author
Anthony Xu
committed
fixed NPE
1 parent 9d5b7b7 commit c78f14c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ private boolean doCancelMaintenance(long hostId) {
21012101
_haMgr.cancelScheduledMigrations(host);
21022102
List<VMInstanceVO> vms = _haMgr.findTakenMigrationWork();
21032103
for (VMInstanceVO vm : vms) {
2104-
if (vm.getHostId() != null && vm.getHostId() == hostId) {
2104+
if (vm != null && vm.getHostId() != null && vm.getHostId() == hostId) {
21052105
s_logger.info("Unable to cancel migration because the vm is being migrated: " + vm);
21062106
return false;
21072107
}

0 commit comments

Comments
 (0)