1
0
Fork 0

Handle case where error is nil properly

master
Neal Harrington 2 years ago
parent 2226083273
commit 79f631f6f0

@ -1103,7 +1103,7 @@ func (s *Service) execute(w http.ResponseWriter, r *http.Request) {
}
results, resultsErr = s.cluster.Execute(er, addr, username, password, timeout)
if resultsErr.Error() == "Unauthorized" {
if resultsErr != nil && resultsErr.Error() == "Unauthorized" {
http.Error(w, ErrLeaderNotFound.Error(), http.StatusUnauthorized)
return
}

Loading…
Cancel
Save