Skip to content

Commit d7eae25

Browse files
committed
CLOUDSTACK-9208: Assertion Error in VM_POWER_STATE handler- Fixed
1 parent 850c07c commit d7eae25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,10 @@ protected boolean sendStop(final VirtualMachineGuru guru, final VirtualMachinePr
12801280
final VirtualMachine vm = profile.getVirtualMachine();
12811281
final StopCommand stop = new StopCommand(vm, getExecuteInSequence(vm.getHypervisorType()), checkBeforeCleanup);
12821282
try {
1283-
final Answer answer = _agentMgr.send(vm.getHostId(), stop);
1283+
Answer answer = null;
1284+
if(vm.getHostId() != null) {
1285+
answer = _agentMgr.send(vm.getHostId(), stop);
1286+
}
12841287
if (answer != null && answer instanceof StopAnswer) {
12851288
final StopAnswer stopAns = (StopAnswer)answer;
12861289
if (vm.getType() == VirtualMachine.Type.User) {

0 commit comments

Comments
 (0)