rimashah25 commented on a change in pull request #4934:
URL: https://github.com/apache/trafficcontrol/pull/4934#discussion_r467219986



##########
File path: traffic_ops/traffic_ops_golang/staticdnsentry/staticdnsentry.go
##########
@@ -103,6 +104,11 @@ func (staticDNSEntry TOStaticDNSEntry) Validate() error {
                addressErr = validation.Validate(staticDNSEntry.Address, 
validation.Required, is.IPv6)
        case "CNAME_RECORD":
                addressErr = validation.Validate(staticDNSEntry.Address, 
validation.Required, is.DNSName)
+               address := *staticDNSEntry.Address
+               lastChar := address[len(address)-1:]

Review comment:
       Updated the code to ensure the trailing period check takes place only if 
address length is greater than zero
   
![image](https://user-images.githubusercontent.com/22248619/89679579-a1484a80-d8ae-11ea-807a-84ba99e1c394.png)
   




----------------------------------------------------------------
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:
[email protected]


Reply via email to