mirror of https://github.com/rclone/rclone.git
cmd: fix crash if rclone is invoked without any arguments - Fixes #8378
This commit is contained in:
parent
5086aad0b2
commit
539e96cc1f
|
@ -430,7 +430,7 @@ func initConfig() {
|
|||
}
|
||||
|
||||
// Start the metrics server if configured and not running the "rc" command
|
||||
if os.Args[1] != "rc" {
|
||||
if len(os.Args) >= 2 && os.Args[1] != "rc" {
|
||||
_, err = rcserver.MetricsStart(ctx, &rc.Opt)
|
||||
if err != nil {
|
||||
fs.Fatalf(nil, "Failed to start metrics server: %v", err)
|
||||
|
|
Loading…
Reference in New Issue