diff --git a/KubeArmor/enforcer/bpflsm/enforcer.go b/KubeArmor/enforcer/bpflsm/enforcer.go index a1e2f68510..1a3e11a5dd 100644 --- a/KubeArmor/enforcer/bpflsm/enforcer.go +++ b/KubeArmor/enforcer/bpflsm/enforcer.go @@ -166,6 +166,9 @@ func (be *BPFEnforcer) DestroyBPFEnforcer() error { } for _, link := range be.Probes { + if link == nil { + continue + } if err := link.Close(); err != nil { be.Logger.Err(err.Error()) errBPFCleanUp = true