aboutsummaryrefslogtreecommitdiff
path: root/pkg/config/url.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2023-03-23 11:49:44 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2023-03-23 11:53:29 +0100
commit0a58c435d8f5a2b5df469ea10eb83f06861c23f3 (patch)
tree15bd945817870415b1fb50840c3cf6caa331e2e3 /pkg/config/url.go
parentb0bd54d2b7ff8b9b84f3237d073fea69b75120ce (diff)
downloadfeed2imap-go-0a58c435d8f5a2b5df469ea10eb83f06861c23f3.tar.gz
feed2imap-go-0a58c435d8f5a2b5df469ea10eb83f06861c23f3.tar.bz2
feed2imap-go-0a58c435d8f5a2b5df469ea10eb83f06861c23f3.zip
Fix out of bound panic when Root is the empty string.
This error occured when the target is specified on item level: The global Target was set to the server string with an empty root, because the path itself is treated as being local to the current item. Rationale behind this: We do not want to make assumption about the global root, but need to ensure that all items connect to the same server. Fixes #91.
Diffstat (limited to 'pkg/config/url.go')
-rw-r--r--pkg/config/url.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/config/url.go b/pkg/config/url.go
index 4b3abf7..a5e9f1f 100644
--- a/pkg/config/url.go
+++ b/pkg/config/url.go
@@ -174,7 +174,7 @@ func (u *Url) CommonBaseUrl(other Url) bool {
func (u *Url) RootPath() []string {
path := u.Root
- if path[0] == '/' {
+ if path != "" && path[0] == '/' {
path = path[1:]
}
return strings.Split(path, "/")