[MAGNOLIA-1896] cms:contentNodeIterator throws NPE when there are no paragraphs to iterate over Created: 27/Nov/07  Updated: 23/Jan/13  Resolved: 28/Nov/07

Status: Closed
Project: Magnolia
Component/s: taglibs
Affects Version/s: 3.5 RC1
Fix Version/s: 3.5 RC2

Type: Bug Priority: Major
Reporter: Tom Jensen Assignee: Jan Haderka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 5m
Time Spent: Not Specified
Original Estimate: 5m
Environment:

N/A


Attachments: Text File ContentNodeIterator.patch    
Issue Links:
relation
is related to MAGNOLIA-473 contentNodeIterator: begin, end, step... Closed
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   

as of rev. 13159, when a template has a contentNodeIterator setup like this:

<cms:contentNodeIterator contentNodeCollectionName="mainContent">
<cms:editBar/>
<cms:includeTemplate></cms:includeTemplate>
</cms:contentNodeIterator>

It throws an NPE:

java.lang.NullPointerException
at info.magnolia.cms.taglibs.ContentNodeIterator.getCollection(ContentNodeIterator.java:198)
at info.magnolia.cms.taglibs.ContentNodeIterator.doStartTag(ContentNodeIterator.java:262)

See attached patch for suggested fix, tested against a simple set of paragraphs but not against nested paragraphs.



 Comments   
Comment by Jan Haderka [ 28/Nov/07 ]

Fixed so when contentNodeCollection doesn't exist empty collection is returned to be consistent with previous versions.

Generated at Mon Feb 12 03:31:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.