From 0a58c435d8f5a2b5df469ea10eb83f06861c23f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Thu, 23 Mar 2023 11:49:44 +0100 Subject: 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. --- pkg/config/url.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg') 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, "/") -- cgit v1.2.3