Tiles
  1. Tiles
  2. TILES-305

NPE in InsertAttributeTag when using ignore flag

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.1
    • Labels:
      None
    • Flags:
      Patch

      Description

      Current implementation of InsertAttributeTag throws NPE if there is no such attribute and ignore flag is set to true. GetAsStringTag implies not-null attribute while InsertAttributeTag from which it is derived misses check of ignore flag before rendering. Need to add simple check in InsertAttributeTag.render() like it was in tiles-2.0.5:
      if (attr == null && ignore) {
      return;
      }

        Activity

        Oleg Gorobets created issue -
        Hide
        Antonio Petrelli added a comment -

        Can you provide a fix in the form of a patch?
        Thanks

        Show
        Antonio Petrelli added a comment - Can you provide a fix in the form of a patch? Thanks
        Hide
        Oleg Gorobets added a comment -

        Antonio, I've added patch.

        Show
        Oleg Gorobets added a comment - Antonio, I've added patch.
        Oleg Gorobets made changes -
        Field Original Value New Value
        Attachment InsertAttributeTag.patch [ 13879 ]
        Antonio Petrelli made changes -
        Assignee Antonio Petrelli [ brenmcguire ]
        Hide
        Antonio Petrelli added a comment -

        In fact this bug involves InsertAttributeTag, not only GetAsStringTag, so I modified the summary and the description.

        Show
        Antonio Petrelli added a comment - In fact this bug involves InsertAttributeTag, not only GetAsStringTag, so I modified the summary and the description.
        Antonio Petrelli made changes -
        Summary NPE in GetAsStringTag when using ignore flag NPE in InsertAttributeTag when using ignore flag
        Fix Version/s 2.1.1 [ 21895 ]
        Description Current implementation of GetAsStringTag throws NPE if there is no such attribute and ignore flag is set to true. GetAsStringTag implies not-null attribute while InsertAttributeTag from which it is derived misses check of ignore flag before rendering. Need to add simple check in InsertAttributeTag.render() like it was in tiles-2.0.5:
        if (attr == null && ignore) {
              return;
        }
        Current implementation of InsertAttributeTag throws NPE if there is no such attribute and ignore flag is set to true. GetAsStringTag implies not-null attribute while InsertAttributeTag from which it is derived misses check of ignore flag before rendering. Need to add simple check in InsertAttributeTag.render() like it was in tiles-2.0.5:
        if (attr == null && ignore) {
              return;
        }
        Hide
        Antonio Petrelli added a comment -

        Applied a modified version of the patch provided by Oleg Gorobets.
        Thanks Oleg!

        Show
        Antonio Petrelli added a comment - Applied a modified version of the patch provided by Oleg Gorobets. Thanks Oleg!
        Antonio Petrelli made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Antonio Petrelli added a comment -

        Closed due to the release of Tiles 2.1.1

        Show
        Antonio Petrelli added a comment - Closed due to the release of Tiles 2.1.1
        Antonio Petrelli made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status [ 45370 ] Struts - editable closed status (temporary) [ 45807 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status (temporary) [ 45807 ] Struts - editable closed status [ 49527 ]
        Antonio Petrelli made changes -
        Workflow Struts - editable closed status [ 49527 ] Simplified [ 53289 ]
        Jeff Turner made changes -
        Project Import Mon Feb 01 01:30:28 UTC 2010 [ 1264987828110 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        2d 22h 58m 1 Antonio Petrelli 26/Sep/08 19:29
        Resolved Resolved Closed Closed
        102d 19h 30m 1 Antonio Petrelli 07/Jan/09 13:59

          People

          • Assignee:
            Antonio Petrelli
            Reporter:
            Oleg Gorobets
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development