You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by zr...@apache.org on 2022/06/17 17:05:57 UTC

[trafficcontrol] branch master updated: Fix t3c panic on failed TO request (#6908)

This is an automated email from the ASF dual-hosted git repository.

zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 5cb50db06c Fix t3c panic on failed TO request (#6908)
5cb50db06c is described below

commit 5cb50db06c94986eef196004a857886470d2fb64
Author: Robert O Butts <ro...@users.noreply.github.com>
AuthorDate: Fri Jun 17 11:05:53 2022 -0600

    Fix t3c panic on failed TO request (#6908)
---
 cache-config/t3cutil/getdatacfg.go | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/cache-config/t3cutil/getdatacfg.go b/cache-config/t3cutil/getdatacfg.go
index a1e1e40c50..b9661490cd 100644
--- a/cache-config/t3cutil/getdatacfg.go
+++ b/cache-config/t3cutil/getdatacfg.go
@@ -794,10 +794,12 @@ func GetConfigData(toClient *toreq.TOClient, disableProxy bool, cacheHostName st
 		return true
 	})
 
-	err := error(nil)
-	toData.ServerParams, err = atscfg.GetServerParameters(toData.Server, combineParams(toData.ServerProfilesParams))
-	if err != nil {
-		errs = append(errs, err)
+	if len(errs) == 0 && toData.Server != nil {
+		err := error(nil)
+		toData.ServerParams, err = atscfg.GetServerParameters(toData.Server, combineParams(toData.ServerProfilesParams))
+		if err != nil {
+			errs = append(errs, err)
+		}
 	}
 
 	return toData, util.JoinErrs(errs)
@@ -835,7 +837,10 @@ func runParallel(fs []func() error) []error {
 		go func() { doneChan <- f() }()
 	}
 	for i := 0; i < len(fs); i++ {
-		errs = append(errs, <-doneChan)
+		err := <-doneChan
+		if err != nil {
+			errs = append(errs, err)
+		}
 	}
 	return errs
 }