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

        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.
        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.
        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!
        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development