diff --git a/lib/web/apiserver.go b/lib/web/apiserver.go index a285ea8e1b8f9..e1b3d49a96f51 100644 --- a/lib/web/apiserver.go +++ b/lib/web/apiserver.go @@ -1636,7 +1636,9 @@ func (h *Handler) getWebConfig(w http.ResponseWriter, r *http.Request, p httprou var automaticUpgradesTargetVersion string if automaticUpgradesEnabled { automaticUpgradesTargetVersion, err = h.cfg.AutomaticUpgradesChannels.DefaultVersion(r.Context()) - h.log.WithError(err).Error("Cannot read target version") + if err != nil { + h.log.WithError(err).Error("Cannot read target version") + } } webCfg := webclient.WebConfig{