diff --git a/omod/src/main/java/org/openmrs/web/controller/report/CohortReportFormController.java b/omod/src/main/java/org/openmrs/web/controller/report/CohortReportFormController.java index 82cc6dc..b2445fd 100644 --- a/omod/src/main/java/org/openmrs/web/controller/report/CohortReportFormController.java +++ b/omod/src/main/java/org/openmrs/web/controller/report/CohortReportFormController.java @@ -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; }