Uploaded image for project: 'Attachments Module'
  1. Attachments Module
  2. ATT-33

Using default complex obs handlers results in NPE making valid files inaccessible

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Labels:
      None
    • Complexity:
      Low

      Description

      When using the default handlers like BinaryDataHandler for a complex obs, after creating the complex obs and adding the permitted concept uuid to the GP, the thumbnail and link in the clinician facing dashboard widget and the attachments manage page both result in a NPEs at

      https://github.com/openmrs/openmrs-module-attachments/blob/f77901d1b5977573f5c46554d526a0a36f98753e/omod/src/main/java/org/openmrs/module/attachments/web/controller/AttachmentsController.java#L113-L114

      because complexObs is null when the view is not "RAW_VIEW"

      e.g.
      https://github.com/openmrs/openmrs-core/blob/8b870c34732a9c5ba4f312877eab1f8222b5ad48/api/src/main/java/org/openmrs/obs/handler/BinaryDataHandler.java#L60-L77

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                reagan Reagan patrick Makoba
                Reporter:
                long27km Ken Long
                Designated Committer:
                Dimitri R
                Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 3 hours
                    3h
                    Remaining:
                    Remaining Estimate - 3 hours
                    3h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified