Uploaded image for project: 'Jetspeed 2'
  1. Jetspeed 2
  2. JS2-1000

Portalstatistics can cause NullPointerException in TreeMap.compare method when request.getRemoteAttr() returns (sometimes) null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.4, 2.2.0
    • Fix Version/s: 2.1.4, 2.2.0
    • Component/s: Statistics
    • Labels:
      None

      Description

      In the PortalStatistics, a TreeMap with state for each logged in username is maintained keyed on the IP address of the current (login/logout) request.
      However, request.getRemoteAttr() sometimes might return null (bad request) in which case adding a null key to the TreeMap might cause a NullPointerException in its internal compare method.
      This is not a critical error as failing to record or remove one entry is not causing real side-effects, and no exception will thrown out from the login/login statistics method, but it can show up in logging.

      I'll provide an easy and non-intrusive fix preventing the NPE in the first place.

        Attachments

          Activity

            People

            • Assignee:
              adouma Ate Douma
              Reporter:
              adouma Ate Douma
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: