alficles commented on a change in pull request #1950: Added CRUD for /parameters
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/1950#discussion_r171947506
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/systeminfo/system_info.go
 ##########
 @@ -87,15 +88,18 @@ WHERE p.config_file='global'`
 
        info := make(map[string]string)
        for rows.Next() {
-               p := tc.Parameter{}
+               p := tc.ParameterNullable{}
                if err = rows.StructScan(&p); err != nil {
                        return nil, fmt.Errorf("getting system_info: %v", err)
                }
-               if p.Secure && privLevel < auth.PrivLevelAdmin {
+               isSecure := *p.Secure
+               name := p.Name
+               value := p.Value
+               if isSecure && privLevel < auth.PrivLevelAdmin {
                        // Secure params only visible to admin
                        continue
                }
-               info[p.Name] = p.Value
+               info[*name] = *value
 
 Review comment:
   This will panic if name or value are null, but they haven't been checked 
anywhere.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to