From ff2eed8ee90893389e15d6ddc222fb2fd8dcf3ae Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Tue, 12 Dec 2023 18:18:19 +0100 Subject: [PATCH] portable mode: fix panic while validating TLS certificates Fixes #1480 Signed-off-by: Nicola Murino --- internal/common/tlsutils.go | 4 +++- internal/vfs/s3fs.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/common/tlsutils.go b/internal/common/tlsutils.go index f6ac1382..a96b9aca 100644 --- a/internal/common/tlsutils.go +++ b/internal/common/tlsutils.go @@ -308,6 +308,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 } diff --git a/internal/vfs/s3fs.go b/internal/vfs/s3fs.go index 0f280aa7..3c0c7c70 100644 --- a/internal/vfs/s3fs.go +++ b/internal/vfs/s3fs.go @@ -699,8 +699,8 @@ func (fs *S3Fs) Walk(root string, walkFn filepath.WalkFunc) error { continue } err := walkFn(util.GetStringFromPointer(fileObject.Key), - NewFileInfo(name, isDir, util.GetIntFromPointer(fileObject.Size), util.GetTimeFromPointer(fileObject.LastModified), - false), nil) + NewFileInfo(name, isDir, util.GetIntFromPointer(fileObject.Size), + util.GetTimeFromPointer(fileObject.LastModified), false), nil) if err != nil { return err }