Uploaded image for project: 'Google Code-in'
  1. Google Code-in
  2. GCI-240

Possible null pointer dereference due to return value of folder.listFiles() in OpenmrsUtil

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Labels:

      Description

      On lines https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/util/OpenmrsUtil.java#L322

      And https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/util/OpenmrsUtil.java#L904

      you will get a null pointer exception if folder.listFiles() returns null or fileList is null. We therefore need to check for null before using.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                navareth Bartłomiej Rasztabiga
                Reporter:
                dkayiwa Daniel Kayiwa
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

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