Skip to content

Commit

Permalink
catch npe
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Dec 31, 2023
1 parent 8ab2b7e commit 20dc52d
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,17 @@ protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse
}

private Node findChild(Node parent, String name) {
if (parent != null) {
NodeList list = parent.getChildNodes();
for (int i = 0; i < list.getLength(); ++i) {
Node node = list.item(i);
if (node.getNodeName().equals(name))
return node;
}
if (parent == null) {
return null;
}

NodeList list = parent.getChildNodes();
for (int i = 0; i < list.getLength(); ++i) {
Node node = list.item(i);
if (node.getNodeName().equals(name))
return node;
}

return null;
}

Expand Down

0 comments on commit 20dc52d

Please sign in to comment.