Skip to content

Commit 6a07aed

Browse files
Anthony Xuyadvr
authored andcommitted
fixed NPE
(cherry picked from commit 98b416b) Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 12aef67 commit 6a07aed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ private boolean doCancelMaintenance(long hostId) {
20522052
_haMgr.cancelScheduledMigrations(host);
20532053
List<VMInstanceVO> vms = _haMgr.findTakenMigrationWork();
20542054
for (VMInstanceVO vm : vms) {
2055-
if (vm.getHostId() != null && vm.getHostId() == hostId) {
2055+
if (vm != null && vm.getHostId() != null && vm.getHostId() == hostId) {
20562056
s_logger.info("Unable to cancel migration because the vm is being migrated: " + vm);
20572057
return false;
20582058
}

0 commit comments

Comments
 (0)