diff --git a/go/weed/weed_server/master_server.go b/go/weed/weed_server/master_server.go index ac28e678d..417aa81bd 100644 --- a/go/weed/weed_server/master_server.go +++ b/go/weed/weed_server/master_server.go @@ -94,8 +94,8 @@ func (ms *MasterServer) proxyToLeader(f func(w http.ResponseWriter, r *http.Requ ms.bounedLeaderChan <- 1 defer func() { <-ms.bounedLeaderChan }() targetUrl, err := url.Parse("http://" + ms.Topo.RaftServer.Leader()) - if err != nil { - writeJsonQuiet(w, r, map[string]interface{}{"error": "Leader URL Parse Error " + err.Error()}) + if err != nil || ms.Topo.RaftServer.Leader() == "" { + writeJsonQuiet(w, r, map[string]interface{}{"error": "Leader URL http://" + ms.Topo.RaftServer.Leader() + " Parse Error " + err.Error()}) return } glog.V(4).Infoln("proxying to leader", ms.Topo.RaftServer.Leader())