Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.8.4
-
Fix Version/s: 1.8.6, 2.0-beta-3
-
Component/s: XML Processing
-
Labels:None
-
Environment:any
-
Number of attachments :
Description
NullPointerException at groovy.xml.dom.DOMCategory.setValue(DOMCategory.java:261) if setting value on element that has no text.
Example is to modify input in the example shown on the "Updating XML with DOMCategory" page (http://groovy.codehaus.org/Updating+XML+with+DOMCategory) to include an empty<item/> element, like this:
...
<category type="groceries">
<item>Chocolate</item>
<item>Coffee</item>
<item/>
</category>
...
This modification to input causes NullPointerException at this line in the
example:
g.value = 'Luxury ' + g.text()
Fixed. Thanks for the suggestion Brad.