diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index cb3044c4..05064e87 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -4193,7 +4193,7 @@ sub vm_stop { eval { if ($shutdown) { - if (!$nocheck && $conf->{agent}) { + if (defined($conf) && $conf->{agent}) { vm_qmp_command($vmid, { execute => "guest-shutdown" }, $nocheck); } else { vm_qmp_command($vmid, { execute => "system_powerdown" }, $nocheck);