Skip to content

Commit

Permalink
BUG/MINOR: fix nil pointer in refreshCerts
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hdurand0710 committed May 15, 2024
1 parent 853d66e commit ddf9090
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/haproxy/certs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddf9090

Please sign in to comment.