Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9314

HTL null pointer in ObjectModel.toBoolean(Object) when object.toString() returns null

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scripting HTL Runtime 1.0.0-1.4.0, Scripting HTL Runtime 1.1.0-1.4.0, Scripting HTL Runtime 1.1.2-1.4.0
    • Fix Version/s: None
    • Component/s: Scripting
    • Labels:
      None

      Description

      Though it is bad practice, it is possible that an object can return null from its toString() method. ObjectModel.toBoolean(Object) [Line 161] calls .trim() on a potentially null object.

      This causes a difficult to troubleshoot, deeply nested, and cryptic exception to be raised. If object.toString() returns null, then it should be treated the same as nearly the rest of HTL, where null is considered "falsey". Doing so will save hours of difficult troubleshooting.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              paul.bjorkstrand Paul Bjorkstrand
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: