Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-254

in #foreach: if nulls are encountered last value is returned instead of null

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • Bugzilla Id:
      27741

      Description

      I put an object having a method that returns an array of Integers in the context
      with contents
      [100,100,NULL,NULL,...]
      Then looping over the contents using
      #foreach ($elt in $Object.List) $!elt #end

      ALL entries become 100 with output:
      100 100 100 100 (...)
      instead of the expected
      100 100

      When converting all null objects to say new Integer(0) in the
      getList() body before returning the list, output becomes
      100 100 0 0 0 0 0

      Apparently null values are not treated as first citizens,

      Cheers,

      Indra

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              indra@feeddex.nl Indra Polak
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: