web: fix potential panic

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-26 14:24:44 +01:00
parent 410d1b97cd
commit 27e4c7027c
1 changed files with 2 additions and 2 deletions

View File

@ -51,8 +51,8 @@ func (w *Watcher) Check() {
return return
} }
for _, t := range tenants.Results { for _, t := range tenants.Results {
if t.WebCertificate.IsSet() { if kp := t.WebCertificate.Get(); kp != nil {
err := w.cs.AddKeypair(*t.WebCertificate.Get()) err := w.cs.AddKeypair(*kp)
if err != nil { if err != nil {
w.log.WithError(err).Warning("failed to add certificate") w.log.WithError(err).Warning("failed to add certificate")
} }