Skip to content

Commit

Permalink
fix: print results if not nil for rest CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss committed Dec 4, 2023
1 parent 951fcbe commit 50dca15
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/tools/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,14 @@ outer:
}
}

pretty, err := json.MarshalIndent(results, "", " ")
if err != nil {
stderr("error marshalling json %+v\n", err)
return
if results != nil {
pretty, err := json.MarshalIndent(results, "", " ")
if err != nil {
stderr("error marshalling json %+v\n", err)
return
}
fmt.Printf("%s\n", pretty)
}
fmt.Printf("%s\n", pretty)
}

func GetPollerAndAddr(pName string) (*conf.Poller, string, error) {
Expand Down

0 comments on commit 50dca15

Please sign in to comment.