[ https://issues.apache.org/jira/browse/FLEX-13994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13431103#comment-13431103 ]
João Fernandes commented on FLEX-13994: --------------------------------------- Could we fix this issue? Clearly the fix is just to set var curY:Number = offscreenExtraRowsTop > 0 ? rowInfo[offscreenExtraRowsTop-1].y + rowHeight : 0; instead of var curY:Number = offscreenExtraRowsTop ? rowInfo[offscreenExtraRowsTop-1].y + rowHeight : 0; It's the same fix for both ListBase.as and AdvancedListBase.as. > ListBase throws an exception due to lack of error checking > ---------------------------------------------------------- > > Key: FLEX-13994 > URL: https://issues.apache.org/jira/browse/FLEX-13994 > Project: Apache Flex > Issue Type: Improvement > Components: mx: List > Affects Versions: Adobe Flex SDK 3.0 (Release) > Environment: Affected OS(s): Windows > Affected OS(s): Windows XP > Browser: Internet Explorer 7.x > Language Found: English > Reporter: Adobe JIRA > Priority: Minor > Fix For: Adobe Flex SDK 3.0 (Release) > > > Steps to reproduce: > 1. Create a ListBox object > 2. Dynamicaly load a dataProvider every so often > > Actual Results: > ListBase throws an exception every once in a while > > Expected Results: > No exception thrown > > Workaround (if any): > None > Description: > In the file ListBase.as there is a function "makeRowsAndColumnsWithExtraRows" > starting on line 1326. > line 1337 reads: > offscreenExtraRowsTop = Math.min(desiredExtraRowsTop, > verticalScrollPosition); > Every so often, and I'm not sure why, the value for verticalScrollPosition > is set to -1 and so the value for offscreenExtraRowsTop is also -1. > Line 1348 reads: > var curY:Number = offscreenExtraRowsTop ? > rowInfo[offscreenExtraRowsTop-1].y + rowHeight : 0; > and should read: > var curY:Number = (offscreenExtraRowsTop > 0) ? > rowInfo[offscreenExtraRowsTop-1].y + rowHeight : 0; > When verticalScrollPosition is set to -1 this causes the calculation > (offscreenExtraRowsTop-1) on line 1348 to come out at -2 and an exception is > thrown since -2 is not a valid entry in 'rowInfo.' > If my proposed change to line 1348 was made then the exception would not be > thrown because the calculation would not happen and the default value of 0 > would be returned. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira