This is an automated email from the ASF dual-hosted git repository.

rob pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit 2f5e7a480e8175026a7f00050e1a1f3522deb622
Author: ASchmidt <andrew_schm...@comcast.com>
AuthorDate: Tue May 22 16:59:52 2018 -0600

    Added nil checking for the Replace attribute
---
 traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go 
b/traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
index a1d6ecf..febb24e 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
@@ -325,7 +325,13 @@ func GetReplaceHandler(db *sqlx.DB) http.HandlerFunc {
                }
 
                if dsId == nil {
-                       log.Error.Printf("no delivery service id sent in POST; 
could not begin transaction: %v", err)
+                       log.Error.Printf("no deliveryservice id sent in POST; 
could not begin transaction: %v", err)
+                       handleErrs(http.StatusBadRequest, err)
+                       return
+               }
+
+               if payload.Replace == nil {
+                       log.Error.Printf("no 'replace' indicator sent in POST; 
could not begin transaction: %v", err)
                        handleErrs(http.StatusBadRequest, err)
                        return
                }

-- 
To stop receiving notification emails like this one, please contact
r...@apache.org.

Reply via email to