Skip to content

Commit 539e96c

Browse files
authored
cmd: fix crash if rclone is invoked without any arguments - Fixes rclone#8378
1 parent 5086aad commit 539e96c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ func initConfig() {
430430
}
431431

432432
// Start the metrics server if configured and not running the "rc" command
433-
if os.Args[1] != "rc" {
433+
if len(os.Args) >= 2 && os.Args[1] != "rc" {
434434
_, err = rcserver.MetricsStart(ctx, &rc.Opt)
435435
if err != nil {
436436
fs.Fatalf(nil, "Failed to start metrics server: %v", err)

0 commit comments

Comments
 (0)