[MAGNOLIA-6382] ModeDependentRenderExceptionHandler fails with NPE when exception is thrown rendering optional area Created: 18/Sep/15  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 5.4.2
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Tobias Mattsson Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

When an optional area is rendered there is no content node. When there's an error during rendering the exception ends up in ModeDependentRenderExceptionHandler where it tries to create an informational message including the node that was rendered. This fails due to an NPE. The original exception is never logged.

Caused by: java.lang.NullPointerException
	at info.magnolia.rendering.engine.ModeDependentRenderExceptionHandler.handleException(ModeDependentRenderExceptionHandler.java:78)
	at info.magnolia.rendering.context.AggregationStateBasedRenderingContext.handleException(AggregationStateBasedRenderingContext.java:220)
	at info.magnolia.rendering.engine.DefaultRenderingEngine.render(DefaultRenderingEngine.java:120)
	at info.magnolia.rendering.engine.DefaultRenderingEngine$$EnhancerByCGLIB$$88a4d454.render(<generated>)
	at info.magnolia.templating.elements.AreaElement.end(AreaElement.java:330)
	... 134 more

A workaround for finding out what the original exception was one can use exception breakpoints while debugging.



 Comments   
Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 04:14:00 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.