[ 
https://issues.apache.org/jira/browse/FLEX-33311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15426488#comment-15426488
 ] 

Mihai Chira commented on FLEX-33311:
------------------------------------

[~riastar], thank you for reporting this and adding sample code. It was very 
useful, and with your help (and Alex's) the bug is now fixed.

> Null pointer fatal in ConstraintLayout when executing Transition on 
> DropDownList
> --------------------------------------------------------------------------------
>
>                 Key: FLEX-33311
>                 URL: https://issues.apache.org/jira/browse/FLEX-33311
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: DropDownList, Spark: Layout, Transitions
>    Affects Versions: Apache Flex 4.8 (parity release)
>            Reporter: Maxime Cowez
>            Assignee: Mihai Chira
>             Fix For: Apache Flex 4.16.0
>
>         Attachments: Main.mxml, SpecifiableListWrapper.as, 
> SpecifiableListWrapperHorizontalSkin.mxml, stack.xml
>
>
> 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*:
> # Compile and run Main.mxml
> # Select the first item in the list
> # 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()}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to