From 1b6441e03e5fcc1a4a8c51acf2481d50851b4fa5 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Wed, 22 Feb 2023 11:47:26 +0100 Subject: [PATCH] Fix crash for relative links --- Sources/Generator/Content/Element.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Generator/Content/Element.swift b/Sources/Generator/Content/Element.swift index 7c35a36..e3702cb 100644 --- a/Sources/Generator/Content/Element.swift +++ b/Sources/Generator/Content/Element.swift @@ -431,7 +431,7 @@ extension Element { // Find the common elements of the path, which can be discarded var index = 0 - while pageParts[index] == ownParts[index] { + while index < pageParts.count && index < ownParts.count && pageParts[index] == ownParts[index] { index += 1 } // The relative path needs to go down to the first common folder,