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:04:05 UTC

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

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



##########
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:
       This could panic, right? This seems like a fatal error anyways, but maybe the enroller should exit gracefully instead.




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