diff --git a/lib/transformer/LinkTransformer.ts b/lib/transformer/LinkTransformer.ts index 1c51856..9b74e73 100644 --- a/lib/transformer/LinkTransformer.ts +++ b/lib/transformer/LinkTransformer.ts @@ -103,7 +103,7 @@ const rewriteInternalLinks = ( pageTitle = findLinkedPageInTree( flatPages, path.join(path.dirname(baseUrl), linkedPageFqfn), - ).pageTitle; + )?.pageTitle; LOGGER.debug( `Rewrite link to other page with title ${pageTitle} original link was ${href}`, );