Skip to content

Commit

Permalink
fix: avoid panic os.Args[1] (GreptimeTeam#190)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored Feb 21, 2024
1 parent 117cbfb commit 7fb3796
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/gtctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func main() {
panic(err)
}

if pm.ShouldRun(os.Args[1]) {
if len(os.Args) > 1 && pm.ShouldRun(os.Args[1]) {
if err = pm.Run(os.Args[1:]); err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down

0 comments on commit 7fb3796

Please sign in to comment.