Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.8.4
-
None
-
any
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()