fix(server): Duplicated Worker nil check inside Worker nil check stmt

This commit is contained in:
Hugo Vieira committed 2021-12-08 17:09:16 +00:00
1 parent e50541cfc7
commit a097b6db8f
1 file changed
+5 -7
+5 -7
View File
@@ -270,14 +270,12 @@ func (c *Command) Run(args []string) int {
return base.CommandUserError
}
if c.Config.Worker != nil {
if err := c.SetupWorkerPublicAddress(c.Config, ""); err != nil {
c.UI.Error(err.Error())
return base.CommandUserError
}
c.InfoKeys = append(c.InfoKeys, "worker public proxy addr")
c.Info["worker public proxy addr"] = c.Config.Worker.PublicAddr
if err := c.SetupWorkerPublicAddress(c.Config, ""); err != nil {
c.UI.Error(err.Error())
return base.CommandUserError
}
c.InfoKeys = append(c.InfoKeys, "worker public proxy addr")
c.Info["worker public proxy addr"] = c.Config.Worker.PublicAddr
if c.Config.Controller != nil {
switch len(c.Config.Worker.Controllers) {