Necoro / feed2imap-go

A software to convert rss feeds into mails.
GNU General Public License v2.0
53 stars 7 forks source link

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

Closed nomeata closed 1 year ago

nomeata commented 1 year ago

Thanks for providing a maintained version of feed2imap, I am a log-time user!

Trying to migrate I run into this panic:

~ $ feed2imap-go -f ~/.feed2imaprc
2023/03/23 10:52:14  WARN: Unknown global option 'include-images'. Ignored!
panic: runtime error: index out of range [0] with length 0

goroutine 6 [running]:
github.com/Necoro/feed2imap-go/pkg/config.(*Url).RootPath(0xc000836a68?)
    github.com/Necoro/feed2imap-go/pkg/config/url.go:177 +0x79
github.com/Necoro/feed2imap-go/internal/imap.Connect({{0xc00003e480, 0x5}, {0xc00002a9a8, 0x18}, {0xc00003e4a3, 0x8}, {0xc00003e4ac, 0x10}, {0xa4d362, 0x3}, ...})
    github.com/Necoro/feed2imap-go/internal/imap/imap.go:33 +0x2dd
main.run.func1()
    github.com/Necoro/feed2imap-go/main.go:137 +0x98
created by main.run
    github.com/Necoro/feed2imap-go/main.go:135 +0x430

Maybe due to my old-style

    target: imaps://YYYYY:XXXXX@imap.mailbox.org/XFeeds/Meine%20Bilder

entry?

nomeata commented 1 year ago

Indeed switching to the suggested layout, with a top-level target, helps, so low priority.

Necoro commented 1 year ago

Hi Joachim, so, if understood you correctly, you have the full old-style target on the item which breaks. But moving it to top-level works?

I'll look into it. Thanks for the report.

nomeata commented 1 year ago

Moving it to top-level and breaking up into separate fields