[MGNLETK-70] NPE when attempting to use DomainNamePathTransformer outside of webcontext Created: 30/Jan/12  Updated: 26/Apr/12  Resolved: 05/Apr/12

Status: Closed
Project: Extended Templating Kit (closed)
Component/s: multisite
Affects Version/s: 1.4.2, 1.4.4
Fix Version/s: 1.4.5

Type: Bug Priority: Major
Reporter: Michiel Meeuwissen Assignee: Ondrej Chytil
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File stacktrace.txt    
Issue Links:
duplicate
is duplicated by MGNLETK-76 NullPointerException when calling Mag... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

Exception in stacktrace.txt

In the code:

WebContext ctx = MgnlContext.getWebContextOrNull();
ExtendedAggregationState state = (ExtendedAggregationState) ctx.getAggregationState();

So, at least it is a bit strange that it does 'getWebContextOrNull' and than doesn't anticipate the null.



 Comments   
Comment by Ondrej Chytil [ 31/Jan/12 ]

Thanks for reporting this issue.

Comment by Magnolia International [ 16/Feb/12 ]

I'm getting the exact same issue. I'm guessing something's misconfigured somewhere ? But what… ?

Comment by Magnolia International [ 16/Feb/12 ]

Ok, a quick glance at the code and as pointed by Michiel above,

  • the code calls getWebContextOrNull. This is silly. If the code is not meant to work outside a webcontext (which it doesn't), then tell the users early instead of accidentally relying on a NPE for this !
  • links can't thus be generated outside a WebContext (so forget about observation), which… is a problem !
Generated at Mon Feb 12 01:48:11 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.