rawlinp commented on code in PR #6786:
URL: https://github.com/apache/trafficcontrol/pull/6786#discussion_r859285946


##########
traffic_monitor/towrap/towrap.go:
##########
@@ -431,23 +439,23 @@ func (s TrafficOpsSessionThreadsafe) CRConfigRaw(cdn 
string) ([]byte, error) {
        }
        defer s.crConfigHist.Add(hist)
 
-       crc := &tc.CRConfig{}
-       json := jsoniter.ConfigFastest
-       if err = json.Unmarshal(data, crc); err != nil {
-               err = errors.New("invalid JSON: " + err.Error())
-               hist.Err = err
-               return data, err
+       if crConfig != nil {
+               if err = json.Unmarshal(configBytes, *crConfig); err != nil {

Review Comment:
   Wait, do we even need to dereference `crConfig` here? Isn't the 2nd arg 
supposed to be a pointer? Should `crConfig` be initialized on L381 so that it's 
non-nil in either case?



-- 
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]

Reply via email to