From a3d6d9cd3318af23c11bbf0442567293b66b8901 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Tue, 12 Dec 2023 18:19:56 +0100 Subject: [PATCH] portable mode: fix panic while validating TLS certificates Fixes #1480 Signed-off-by: Nicola Murino --- internal/common/tlsutils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/common/tlsutils.go b/internal/common/tlsutils.go index 5c124ad7..f8930768 100644 --- a/internal/common/tlsutils.go +++ b/internal/common/tlsutils.go @@ -299,6 +299,8 @@ func NewCertManager(keyPairs []TLSKeyPair, configDir, logSender string) (*CertMa } randSecs := rand.Intn(59) manager.monitor() - _, err = eventScheduler.AddFunc(fmt.Sprintf("@every 8h0m%ds", randSecs), manager.monitor) + if eventScheduler != nil { + _, err = eventScheduler.AddFunc(fmt.Sprintf("@every 8h0m%ds", randSecs), manager.monitor) + } return manager, err }