diff --git a/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go b/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go index 21cd6ae4e..36894e3d4 100644 --- a/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go +++ b/images/virtualization-artifact/pkg/controller/vd/internal/inuse.go @@ -77,10 +77,12 @@ func (h InUseHandler) Handle(ctx context.Context, vd *virtv2.VirtualDisk) (recon if err != nil { return reconcile.Result{}, fmt.Errorf("error getting kubevirt virtual machine: %w", err) } - - if kvvm.Status.StateChangeRequests != nil { - inUseInRunningVirtualMachine = true + if kvvm != nil { + if kvvm.Status.StateChangeRequests != nil { + inUseInRunningVirtualMachine = true + } } + } } }