on mac os x there is a null pointer if you call getLength() on an empty node list, so add a second check there (hope this helps ... but I doubt it).

cusax-fix
Emil Ivov 19 years ago
parent 37c4fda89f
commit d523e50b6b

@ -111,7 +111,11 @@ public void write(Node element, Writer out, int indent,
// Write child elements and text
boolean hasChildren = false;
NodeList children = element.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
for (int i = 0
; element.hasChildNodes()
&& i < children.getLength()
; i++)
{
Node child = children.item(i);
switch (child.getNodeType()) {

Loading…
Cancel
Save