From bf2366ba3aba55926779c7804849273d7ff376b7 Mon Sep 17 00:00:00 2001 From: qinguoyi <1532979219@qq.com> Date: Sat, 3 Aug 2024 02:06:48 +0800 Subject: [PATCH] Fix KeyMaterial nil bug (#5849) --- weed/command/filer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/command/filer.go b/weed/command/filer.go index 77e312646..b7f67ea3b 100644 --- a/weed/command/filer.go +++ b/weed/command/filer.go @@ -240,6 +240,9 @@ func runFiler(cmd *Command, args []string) bool { // GetCertificateWithUpdate Auto refreshing TSL certificate func (fo *FilerOptions) GetCertificateWithUpdate(*tls.ClientHelloInfo) (*tls.Certificate, error) { certs, err := fo.certProvider.KeyMaterial(context.Background()) + if certs == nil { + return nil, err + } return &certs.Certs[0], err }