Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-13124

Backport OPENIDM-13111: !== in mergeWithTarget.js (and possibly other scripts) doesn't check if value is undefined only if value is null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0.0.1
    • Fix Version/s: 6.5.0.2, 6.0.0.6
    • Component/s: None

      Description

      In mergeWithTarget.js there is a typo that is probably causing an issue. On line 37, it states:

      if (existingTargetObject != null && existingTargetObject[attributeName] !== null)

      {     mergeValues(targetObject, attributeName, existingTargetObject[attributeName]); }

      Notice the !== should be !=

      if (existingTargetObject != null && existingTargetObject[attributeName] != null)

      {    mergeValues(targetObject, attributeName, existingTargetObject[attributeName]); }

       

      !== checks if value is null but not if value is undefined.  

      Error in logs:

      Caused by: org.forgerock.json.resource.InternalServerErrorException: TypeError: Cannot read property "length" from undefined.  

      Believed to be as a results of the below line, where value is undefined:

      for (var x = 0; x < value.length; x++)

      If the above code didn't have a typo the for loop wouldn't have been reached.

       

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naren.koganti Naren Koganti
                Reporter:
                mark.offutt Mark Offutt [X] (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: