Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-33311

Null pointer fatal in ConstraintLayout when executing Transition on DropDownList

    XMLWordPrintableJSON

Details

    Description

      In some very specific cases ConstraintLayout will throw a null pointer error when a component inside it is playing a transition. I tried a few things and found out that:

      • parseConstraints() creates a new rowBaselines Vector (or empties it if it exists)
      • some other process calls clearConstraintCache() in the middle of the execution of parseConstraints(), setting rowBaselines back to null
      • parseConstraints() calls parseElementConstraints() which tries to access elements in rowBaselines and throws the error

      I know very little about how Effects and Transitions work, so the "some other process" part is a bit of a mistery to me.

      Steps to reproduce:

      1. Compile and run Main.mxml
      2. Select the first item in the list
      3. Click on the list and, before the resize transition finishes, click on it again.

      Workaround: subclass ConstraintLayout (or FormItemLayout), override `measure()`, put a try/cacth block around it and use this custom layout. Not exactly pretty but it works without apparent side effects.
      Quick fix (but probably not the ideal solution): just test whether rowBaselines exists before trying to access it in ConstraintLayout.parseElementConstraints().

      Attachments

        1. stack.xml
          5 kB
          Mihai Chira
        2. SpecifiableListWrapperHorizontalSkin.mxml
          1 kB
          Maxime Cowez
        3. SpecifiableListWrapper.as
          5 kB
          Maxime Cowez
        4. Main.mxml
          1 kB
          Mihai Chira

        Activity

          People

            evolverine Mihai Chira
            riastar Maxime Cowez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: