Uploaded image for project: 'Reporting Module'
  1. Reporting Module
  2. REPORT-887

DefinitionLibrary.getDefinition() NullPointerException for null keyPrefix

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Should
    • Resolution: Fixed
    • None
    • 1.24.0
    • None
    • None

    Description

      When calling DefinitionLibrary.getDefinition() where getKeyPrefix() returns null as for this: https://github.com/openmrs/openmrs-module-referencemetadata/blob/referencemetadata-2.12.0/api/src/main/java/org/openmrs/module/referencemetadata/reporting/definition/library/ReferenceApplicationCohortDefinitionLibrary.java#L37

      You get the stack trace below:

      ERROR - BaseRestController.handleException(124) |2022-03-22T23:06:41,407| null
      java.lang.NullPointerException: null
      	at java.lang.String.startsWith(String.java:1405) ~[?:1.8.0_152]
      	at java.lang.String.startsWith(String.java:1434) ~[?:1.8.0_152]
      	at org.openmrs.module.reporting.definition.library.BaseDefinitionLibrary.getDefinition(BaseDefinitionLibrary.java:42) ~[reporting-api-1.23.0.jar:?]
      	at org.openmrs.module.reporting.definition.library.AllDefinitionLibraries.getDefinition(AllDefinitionLibraries.java:51) ~[reporting-api-1.23.0.jar:?]
      	at org.openmrs.module.reportingrest.web.resource.EvaluatedResource.getDefinitionByUniqueId(EvaluatedResource.java:173) ~[reportingrest.jar:?]
      	at org.openmrs.module.reportingrest.web.resource.EvaluatedCohortResource.getEvaluatedCohort(EvaluatedCohortResource.java:141) ~[reportingrest.jar:?]
      	at org.openmrs.module.reportingrest.web.resource.EvaluatedCohortResource.retrieve(EvaluatedCohortResource.java:68) ~[reportingrest.jar:?]
      	at org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceController.retrieve(MainResourceController.java:74) ~[webservices.rest-omod-common-2.30.0-SNAPSHOT.jar:?]
      

      For a REST call like this: /openmrs/ws/rest/v1/reportingrest/cohort/b5d52da9-10c2-43af-ae23-552acc5e445b

      Gliffy Diagrams

        Attachments

          Activity

            People

              dkayiwa Daniel Kayiwa
              dkayiwa Daniel Kayiwa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: