diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-24 15:18:04 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-01-24 15:18:04 +0100 |
commit | 2f718c72a51850f3ab1af8d93a381b594fb2c825 (patch) | |
tree | f506e4d54429b8b7d3ca4a6de5211ce412b42639 | |
parent | 3e178f01710e2e50860c3d5e6e8e346f2d378a5c (diff) |
Fixed crach when no XDS Server connected.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
-rw-r--r-- | main.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -389,6 +389,9 @@ func XdsConnInit(ctx *cli.Context) error { if err := XdsConfigGet(&xdsConf); err != nil { return cli.NewExitError("ERROR while getting XDS config: "+err.Error(), 1) } + if len(xdsConf.Servers) < 1 { + return cli.NewExitError("No XDS Server connected", 1) + } svrCfg := xdsConf.Servers[XdsServerIndexGet()] if (serverURL != "" && svrCfg.URL != serverURL) || !svrCfg.Connected { Log.Infof("Update XDS Server config: serverURL=%v, svrCfg=%v", serverURL, svrCfg) |