1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

cmd: fix crash if rclone is invoked without any arguments - Fixes #8378

This commit is contained in:
Janne Hellsten
2025-02-12 23:31:05 +02:00
committed by Nick Craig-Wood
parent 57bbb4be9f
commit 92efc5ff43

View File

@@ -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)