connection: handle disappearing obj in agent handler

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2024-10-02 12:34:23 -04:00
parent 2ee2dda124
commit dfb1f33040

View File

@ -653,7 +653,7 @@ class vmmConnection(vmmGObject):
# This event is triggered when deleting external snapshots and it changes
# shutoff VM into paused and makes that VM unusable until virt-manager is
# restarted so we need to ignore it in case VM is shutoff.
if obj.is_shutoff(): # pragma: no cover
if obj and obj.is_shutoff(): # pragma: no cover
log.debug("received agent lifecycle event but domain is shutoff, ignoring it")
return