Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4879

NullPointerException at org.openmrs.api.customdatatype.datatype.ConceptDatatype#doGetTextSummary

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: Platform 1.11.5
    • Fix Version/s: Core 2.1.0
    • Component/s: None
    • Labels:
    • Complexity:
      Low

      Description

      passing deserialize(String) into doGetTextSummary(Concept) causes a NullPointerException if the String is blank. The issue arrives at line 44 of ConceptDatatype at concept.getName(). The function doGetTextSummary assumes a non-null concept is passed into it.

      See attached executable bug report, causes an error from:
      openmrs-core/api/src/test/java/org/openmrs/customdatatype/datatype/ConceptDatatypeTest.java
      mvn -Dtest=ConceptDatatypeTest test

      Similarly, many datatypes with a deserialize function return null if the string parameter is blank(i.e. ProviderDatatype, ProgramDatatype). This could be an issue as from what I can see, null is only checked throughout all Customdatatype functions when the input parameter is a string.

        Gliffy Diagrams

          Attachments

            Attachments-Category-Modification

              Activity

                People

                • Assignee:
                  jtatia Jai Tatia
                  Reporter:
                  lemun Lemun Tense
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 1 hour
                    1h
                    Remaining:
                    Time Spent - 35 minutes Remaining Estimate - 25 minutes
                    25m
                    Logged:
                    Time Spent - 35 minutes Remaining Estimate - 25 minutes
                    35m