From 3fef524e3d4d2b294666edf8cb22fac98105b6af Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 10 Oct 2017 10:17:19 +0200 Subject: [PATCH] Fix: Don't panic on non existent PKI path Signed-off-by: Knut Ahlers --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 37cd8cd..c7ee4c0 100644 --- a/main.go +++ b/main.go @@ -327,6 +327,10 @@ func fetchValidCertificatesFromVault() ([]*x509.Certificate, error) { return res, err } + if secret == nil { + return nil, errors.New("Was not able to read list of certificates") + } + if secret.Data == nil { return res, errors.New("Got no data from backend") }