diff --git a/pkg/lib/cockpit.js b/pkg/lib/cockpit.js index eb0e3453cd7..8d2d9e04ad8 100644 --- a/pkg/lib/cockpit.js +++ b/pkg/lib/cockpit.js @@ -1166,8 +1166,8 @@ function factory() { if (self.url_root) pre_parts = self.url_root.split('/').map(decodeURIComponent); - if (input && input[0] !== "/") { - result = [].concat(self.path); + if (input && input[0] !== "/" && self.path !== undefined) { + result = [...self.path]; result.pop(); result = result.concat(parts); } else {