* 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) {
|
public static List<Node> getChildren(String nodeName, Node parentNode) {
|
||||||
List<Node> children = new ArrayList<Node>();
|
List<Node> children = new ArrayList<Node>();
|
||||||
|
|
||||||
for (Node child : new NodeListDecorator(parentNode.getChildNodes())) {
|
if (parentNode != null) {
|
||||||
if (nodeName.equals(child.getNodeName()))
|
for (Node child : new NodeListDecorator(parentNode.getChildNodes())) {
|
||||||
children.add(child);
|
if (nodeName.equals(child.getNodeName()))
|
||||||
|
children.add(child);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return children;
|
return children;
|
||||||
|
Loading…
Reference in New Issue
Block a user