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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5
    • None
    • Engine
    • None
    • Operating System: All
      Platform: PC
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: