rkosegi / jdownloader-cli

JDownloader CLI tool written in Go
Apache License 2.0
20 stars 4 forks source link

Error when adding links from a file #21

Closed Magisdn closed 1 year ago

Magisdn commented 1 year ago

Hi!

./jdownloader-cli links add --from-file links.txt panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]: github.com/rkosegi/jdownloader-cli/internal.parseLinksFromFile({0x7ffec1b35651?, 0x0?}) /home/rkosegi/git/ezz/public/jdownloader-cli/internal/links.go:151 +0x1f1 github.com/rkosegi/jdownloader-cli/internal.newAddLinksCommand.func1(0xc00018c900?, {0x84b8d6?, 0x2?, 0x2?}) /home/rkosegi/git/ezz/public/jdownloader-cli/internal/links.go:63 +0x5d github.com/spf13/cobra.(Command).execute(0xc00018c900, {0xc0001386a0, 0x2, 0x2}) /home/rkosegi/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:940 +0x862 github.com/spf13/cobra.(Command).ExecuteC(0xc00018c000) /home/rkosegi/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd github.com/spf13/cobra.(*Command).Execute(0x8f2de0?) /home/rkosegi/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992 +0x19 main.main() /home/rkosegi/git/ezz/public/jdownloader-cli/cmd/cli.go:25 +0x45

rkosegi commented 1 year ago

Hi @Magisdn, thank you for bug report. Will look into it soon

Magisdn commented 1 year ago

Thanks!