Details
-
Bug
-
Resolution: Won't Fix
-
Low
-
None
-
None
-
None
Description
In the class info.magnolia.templating.functions.TemplatingFunctions if line 873 encounters a NullPointerException during `handleRepositoryException` then a side-effect is that the parameter `e` is ignored, loosing exception context to the other.
We should consider refactoring the logic or adding a second catch to handle the null pointer gracefully.
private void handleRepositoryException(RepositoryException e, String workspace) {
final AggregationState aggregationState = webContextProvider.get().getAggregationState();
String template;
if (aggregationState != null) try {
template = NodeTypes.Renderable.getTemplate(aggregationState.getCurrentContentNode());
} catch (RepositoryException re) {
log.error("Repository Exception: {}", re);
}
log.debug("Exception in '{}' workspace when rendering template '{}' for URI '{}': {}", workspace, template, aggregationState.getOriginalBrowserURI(), e);
}
Checklists
Acceptance criteria