From d08713d1d6c516e5570a7e94039870b1c8be43b1 Mon Sep 17 00:00:00 2001 From: guoguodan <58167141+guoguodan@users.noreply.github.com> Date: Fri, 24 Sep 2021 00:37:12 +0800 Subject: [PATCH] Update config.go (#491) it maybe null point --- cmd/yurthub/app/config/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/yurthub/app/config/config.go b/cmd/yurthub/app/config/config.go index b7f16e8e73e..62fab1fa2de 100644 --- a/cmd/yurthub/app/config/config.go +++ b/cmd/yurthub/app/config/config.go @@ -164,6 +164,9 @@ func Complete(options *options.YurtHubOptions) (*YurtHubConfiguration, error) { } func parseRemoteServers(serverAddr string) ([]*url.URL, error) { + if serverAddr == "" { + return make([]*url.URL, 0), fmt.Errorf("--server-addr should be set for hub agent") + } servers := strings.Split(serverAddr, ",") us := make([]*url.URL, 0, len(servers)) remoteServers := make([]string, 0, len(servers))