Skip to content

Commit

Permalink
catch npe (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 authored Dec 31, 2023
1 parent b458aa3 commit 5d36876
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,17 @@ protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse
}

private Node findChild(Node parent, String name) {
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 5d36876

Please sign in to comment.