Details
Description
Do we still need to fix things in 14.2.2?
The classes
org.hippoecm.hst.pagemodelapi.v09.content.rewriter.HtmlContentRewriter
org.hippoecm.hst.pagemodelapi.v10.content.rewriter.HtmlContentRewriter
have a clear NPE in
final HstLink hstLink = getDocumentLink(documentPath, node, requestContext, targetMount); if (hstLink == null || hstLink.isNotFound() || hstLink.getPath() == null) { if (removeAnchorTagOfBrokenLink) { log.info("Could not create a link for '{}'. Removing the anchor now maintaining the text.", documentPath); final ContentNode textContent = new ContentNode(anchorTag.getText().toString()); anchorTag.getParent().insertChildAfter(anchorTag, textContent); anchorTag.getParent().removeChild(anchorTag); continue; } else { log.info("Could not create a link for '{}'.", documentPath); } } // use link model because the hst link we want is from the 'site mount' and not from the // 'page model api mount' final LinkModel linkModel = LinkModel.convert(hstLink, requestContext);
it should of course be
final HstLink hstLink = getDocumentLink(documentPath, node, requestContext, targetMount); if (hstLink == null || hstLink.isNotFound() || hstLink.getPath() == null) { if (removeAnchorTagOfBrokenLink) { log.info("Could not create a link for '{}'. Removing the anchor now maintaining the text.", documentPath); final ContentNode textContent = new ContentNode(anchorTag.getText().toString()); anchorTag.getParent().insertChildAfter(anchorTag, textContent); anchorTag.getParent().removeChild(anchorTag); } else { log.info("Could not create a link for '{}'.", documentPath); } continue; } // use link model because the hst link we want is from the 'site mount' and not from the // 'page model api mount' final LinkModel linkModel = LinkModel.convert(hstLink, requestContext);