Skip to content

Commit 959c8c9

Browse files
committed
fix getInt() with default when no attrs at all
1 parent ef71f3e commit 959c8c9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

core/src/processing/data/XML.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,14 @@ public String getString(String name) {
724724

725725

726726
public String getString(String name, String defaultValue) {
727-
Node attr = node.getAttributes().getNamedItem(name);
728-
return (attr == null) ? defaultValue : attr.getNodeValue();
727+
NamedNodeMap attrs = node.getAttributes();
728+
if (attrs != null) {
729+
Node attr = attrs.getNamedItem(name);
730+
if (attr != null) {
731+
return attr.getNodeValue();
732+
}
733+
}
734+
return defaultValue;
729735
}
730736

731737

0 commit comments

Comments
 (0)