* fix potential NPE

This commit is contained in:
Reinhard Pointner 2014-12-27 20:13:45 +00:00
parent 6f65e7e942
commit 52a7ba93cc
1 changed files with 5 additions and 3 deletions

View File

@ -58,10 +58,12 @@ public final class XPathUtilities {
public static List<Node> getChildren(String nodeName, Node parentNode) {
List<Node> children = new ArrayList<Node>();
if (parentNode != null) {
for (Node child : new NodeListDecorator(parentNode.getChildNodes())) {
if (nodeName.equals(child.getNodeName()))
children.add(child);
}
}
return children;
}