From ddf90905667faf87f98cd06c58532157a5f1abb5 Mon Sep 17 00:00:00 2001 From: Helene Durand Date: Wed, 15 May 2024 16:12:45 +0200 Subject: [PATCH] BUG/MINOR: fix nil pointer in refreshCerts If the certificate file exists, but is not in use, crt is nil and instance.Reload panics panic: runtime error: invalid memory address or nil pointer dereference --- pkg/haproxy/certs/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/haproxy/certs/main.go b/pkg/haproxy/certs/main.go index 5dba19a5..37305471 100644 --- a/pkg/haproxy/certs/main.go +++ b/pkg/haproxy/certs/main.go @@ -199,7 +199,7 @@ func refreshCerts(certs map[string]*cert, certDir string) (removed bool) { logger.Error(os.Remove(path.Join(certDir, filename))) delete(certs, certName) removed = true - logger.Debugf("secret %s removed, reload required", crt.name) + logger.Debugf("secret %s removed, reload required", certName) } } return