* fix potential NPE
This commit is contained in:
parent
6f65e7e942
commit
52a7ba93cc
|
@ -58,9 +58,11 @@ public final class XPathUtilities {
|
|||
public static List<Node> getChildren(String nodeName, Node parentNode) {
|
||||
List<Node> children = new ArrayList<Node>();
|
||||
|
||||
for (Node child : new NodeListDecorator(parentNode.getChildNodes())) {
|
||||
if (nodeName.equals(child.getNodeName()))
|
||||
children.add(child);
|
||||
if (parentNode != null) {
|
||||
for (Node child : new NodeListDecorator(parentNode.getChildNodes())) {
|
||||
if (nodeName.equals(child.getNodeName()))
|
||||
children.add(child);
|
||||
}
|
||||
}
|
||||
|
||||
return children;
|
||||
|
|
Loading…
Reference in New Issue