0 Replies Latest reply on Nov 24, 2009 3:11 PM by rfrishbe

    [svn:fx-trunk] 12190: Added checks for localIndex == null in getItemIndex() .

    rfrishbe Level 3

      Revision: 12190

      Revision: 12190

      Author:   rfrishbe@adobe.com

      Date:     2009-11-24 15:11:42 -0800 (Tue, 24 Nov 2009)

      Log Message:

      ***********

      Added checks for localIndex == null in getItemIndex().  We do this in other places, like addItemAt().  The reason this could be null is if sort or filterFunction has just been set, but refresh() has not been applied yet.  I thought about not adding it and marking the bug file as NAB so that people would get an RTE and realize their mistake (they need to call refresh()), but given that addItemAt() already does this and the fact that they may have a localIndex based on an old sort (and wouldn?\226?\128?\153t get an RTE in that case), it makes sense to go ahead and add this null check.

       

      I also added a similar check in findItem().  This will still RTE, but I think it will give a better error than a null pointer exception.

       

      QE notes: -

      Doc notes: -

      Bugs: SDK-24268

      Reviewer: Alex

      Tests run: checkintests, mustella List and collections

      Is noteworthy for integration: No

       

      Ticket Links:

      ***********

          http://bugs.adobe.com/jira/browse/SDK-24268

       

      Modified Paths:

      **************

          flex/sdk/trunk/frameworks/projects/framework/src/mx/collections/ListCollectionView.as