Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.10
-
Fix Version/s: 1.2.11
-
Component/s: Templating
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
In the attached test case test0, test2 and test3 work as expected, but test1 throws a nullpointer exception. This occurs when a template iterates over a collection of the root object, or a collection of a property of a root object. The tests show that the error does not occur when the collection is a property of an entry in the map
Eg
test0 - works
String template = "@foreach
a@end{}";
Map map = new HashMap();
map.put("list",list);
String r = TemplateInterpreter.evalToString(template,map);
test1 - fails
Folder f1 = new Folder("f1",null);
String template = "@
@foreach
{children}a@end{}";
String r = TemplateInterpreter.evalToString(template,f1);
class Folder extends Page
{ public List<Page> getChildren() }Activity
Mike Brock
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | In Progress [ 3 ] |
Mike Brock
made changes -
| Resolution | Fixed [ 1 ] | |
| Status | In Progress [ 3 ] | Closed [ 6 ] |
| Fix Version/s | 1.2.11 [ 13807 ] |