diff --git a/classes/urlhelper.php b/classes/urlhelper.php
index 136046701aed581e5a5d03861d79f41b69b3850d..03f0c474df07e7a9bc7b9b29406afcdd91a2ab29 100644
--- a/classes/urlhelper.php
+++ b/classes/urlhelper.php
@@ -51,7 +51,7 @@ class UrlHelper {
 				// (i'm not sure if it's a good idea)
 
 				if (strpos($rel_parts['path'], '/') !== 0) {
-					$rel_parts['path'] = with_trailing_slash($base_parts['path']) . $rel_parts['path'];
+					$rel_parts['path'] = with_trailing_slash($base_parts['path'] ?? "") . $rel_parts['path'];
 				}
 
 				$rel_parts['path'] = str_replace("/./", "/", $rel_parts['path']);