diff --git a/dm/master/server.go b/dm/master/server.go index 99ef3b1ad5..6a6cf8b7c7 100644 --- a/dm/master/server.go +++ b/dm/master/server.go @@ -1867,9 +1867,13 @@ func (s *Server) listMemberMaster(ctx context.Context, names []string) (*pb.Memb } alive := true - _, err := client.Get(etcdMember.ClientURLs[0] + "/health") - if err != nil { + if len(etcdMember.ClientURLs) == 0 { alive = false + } else { + _, err := client.Get(etcdMember.ClientURLs[0] + "/health") + if err != nil { + alive = false + } } masters = append(masters, &pb.MasterInfo{