rob05c commented on code in PR #6908:
URL: https://github.com/apache/trafficcontrol/pull/6908#discussion_r900309910
##########
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 {
Review Comment:
No, but if there's an error, `toData.Server` may be nil, which is the panic
here.
The idiomatically-correct thing to do is to stop processing any data if
there are any errors, i.e. `len(errs) == 0`.
Theoretically, if `len(errs) == 0` then `toData.Server` should never be nil
here; the `toData.Server != nil` is just an additional safety, before
dereferencing it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]