client: prevent EOF when router list is empty
@@ -37,10 +37,12 @@ func (c *RoutersList) Run(context *cmd.Context, client *cmd.Client) error {
return err
}
var routers []router.PlanRouter
+ if response.StatusCode == http.StatusOK {
err = json.NewDecoder(response.Body).Decode(&routers)
if err != nil {
return err
}
+ }
table := cmd.NewTable()
table.Headers = cmd.Row([]string{"Name", "Type"})
table.LineSeparator = true
