You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/04/27 20:36:25 UTC

[GitHub] [trafficcontrol] shamrickus commented on a change in pull request #4666: Fix segfault in enroller.go

shamrickus commented on a change in pull request #4666:
URL: https://github.com/apache/trafficcontrol/pull/4666#discussion_r416130133



##########
File path: infrastructure/cdn-in-a-box/enroller/enroller.go
##########
@@ -560,9 +560,12 @@ func enrollProfile(toSession *session, r io.Reader) error {
 			}
 		}
 		profiles, _, err = toSession.GetProfileByName(profile.Name)
-		if err != nil || len(profiles) == 0 {
+		if err != nil {
 			log.Infof("error getting profile ID from %+v: %s\n", profile, err.Error())
 		}
+		if len(profiles) == 0 {
+			log.Infof("no results returned for getting profile ID from %+v", profile)
+		}
 		profile = profiles[0]

Review comment:
       I agree, I didn't make the change because for all the other enroller methods, they only log not panic. I can change all of them but I figured something like that is better in it's own PR due to the potential side affects.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org