wakatime/wakatime-cli

panic: runtime error: index out of range [0] with length 0

gandarez opened this issue · 0 comments

Environment

  • OS: Windows
  • Platform: amd64
  • Plugin: notepadpp/8.5.2 notepadpp-wakatime/5.1.1 - vscode/1.80.2 vscode-wakatime/24.2.0
  • CLI: v1.73.1

Stacktrace

goroutine 1 [running]:
runtime/debug.Stack()
 /opt/hostedtoolcache/go/1.20.4/x64/src/runtime/debug/stack.go:24 +0x65
github.com/wakatime/wakatime-cli/cmd.runCmd.func1()
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:283 +0x13c
panic({0x977aa0, 0xc000522048})
 /opt/hostedtoolcache/go/1.20.4/x64/src/runtime/panic.go:884 +0x213
github.com/yookoala/realpath.switchSymlinkCom({0xc000556060?, 0xc000556086?, 0x30?}, 0x18?, {0x0?, 0x59?}, {0xc00055a090?, 0xc000556002?})
 /home/runner/go/pkg/mod/github.com/yookoala/realpath@v1.0.0/realpath.go:100 +0x171
github.com/yookoala/realpath.Realpath({0xc000556000, 0x56})
 /home/runner/go/pkg/mod/github.com/yookoala/realpath@v1.0.0/realpath.go:73 +0x515
github.com/wakatime/wakatime-cli/pkg/heartbeat.formatLinuxFilePath(0xc0000d0aa0)
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/heartbeat/format.go:60 +0x6a
github.com/wakatime/wakatime-cli/pkg/heartbeat.Format({{0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0, 0x0, {0x0, 0x0, 0x0}, ...})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/heartbeat/format.go:40 +0x7a
github.com/wakatime/wakatime-cli/pkg/heartbeat.WithFormatting.func1.1({0xc0002f2000, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/heartbeat/format.go:29 +0x17f
github.com/wakatime/wakatime-cli/pkg/heartbeat.NewHandle.func1({0xc0002f2000, 0x1, 0x1})
 /home/runner/work/wakatime-cli/wakatime-cli/pkg/heartbeat/heartbeat.go:171 +0xd1
github.com/wakatime/wakatime-cli/cmd/heartbeat.SendHeartbeats(0xc00008d520, {0xc0002d4da0, 0x1c})
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/heartbeat/heartbeat.go:127 +0x6f6
github.com/wakatime/wakatime-cli/cmd/heartbeat.Run(0xb6dee0?)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/heartbeat/heartbeat.go:36 +0xc6
github.com/wakatime/wakatime-cli/cmd.runCmd(0xc00008d520, 0x0, 0x0, 0xa82648)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:299 +0x122
github.com/wakatime/wakatime-cli/cmd.RunCmdWithOfflineSync(0xc000363220?, 0xec?, 0x41?, 0x0?)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:257 +0x26
github.com/wakatime/wakatime-cli/cmd.Run(0x0?, 0x0?)
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/run.go:119 +0x5d7
github.com/wakatime/wakatime-cli/cmd.NewRootCMD.func1(0xc00033a000?, {0x9ae8d8?, 0xd?, 0xf?})
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/root.go:29 +0x1d
github.com/spf13/cobra.(*Command).execute(0xc00033a000, {0xc0000e2010, 0xd, 0xf})
 /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc00033a000)
 /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
 /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/wakatime/wakatime-cli/cmd.Execute()
 /home/runner/work/wakatime-cli/wakatime-cli/cmd/root.go:260 +0x1e
main.main()
 /home/runner/work/wakatime-cli/wakatime-cli/main.go:6 +0x17