Skip to content

Commit 98b416b

Browse files
Anthony Xuyadvr
authored andcommitted
fixed NPE
(cherry picked from commit c78f14c) Signed-off-by: Rohit Yadav <[email protected]>
1 parent bf17f64 commit 98b416b

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
@@ -2107,7 +2107,7 @@ private boolean doCancelMaintenance(long hostId) {
21072107
_haMgr.cancelScheduledMigrations(host);
21082108
List<VMInstanceVO> vms = _haMgr.findTakenMigrationWork();
21092109
for (VMInstanceVO vm : vms) {
2110-
if (vm.getHostId() != null && vm.getHostId() == hostId) {
2110+
if (vm != null && vm.getHostId() != null && vm.getHostId() == hostId) {
21112111
s_logger.info("Unable to cancel migration because the vm is being migrated: " + vm);
21122112
return false;
21132113
}

0 commit comments

Comments
 (0)