flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - FLEX-34862
Date Mon, 01 Jun 2015 06:51:46 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/develop 386a61818 -> b787537eb


FLEX-34862


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/b787537e
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/b787537e
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/b787537e

Branch: refs/heads/develop
Commit: b787537eb7ad66eee74bdf84fd4a3c2614eaa24b
Parents: 386a618
Author: Harbs <harbs@in-tools.com>
Authored: Mon Jun 1 09:51:35 2015 +0300
Committer: Harbs <harbs@in-tools.com>
Committed: Mon Jun 1 09:51:35 2015 +0300

----------------------------------------------------------------------
 .../spark/src/spark/components/supportClasses/ListBase.as | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b787537e/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as b/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
index a03a30a..c72d4d5 100644
--- a/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
+++ b/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as
@@ -1980,13 +1980,13 @@ public class ListBase extends SkinnableDataContainer implements IDataProviderEnh
 
     /**
      *  @private
-     *  Called when an item has been removed from this component.
+     *  Called on rollover or roll out.
      */
     private function item_mouseEventHandler(event:MouseEvent):void
     {
         var type:String = event.type;
         type = TYPE_MAP[type];
-        if (hasEventListener(type))
+        if (hasEventListener(type) && dataProvider != null)
         {
             var itemRenderer:IItemRenderer = event.currentTarget as IItemRenderer;
             
@@ -1995,7 +1995,11 @@ public class ListBase extends SkinnableDataContainer implements IDataProviderEnh
                 itemIndex = itemRenderer.itemIndex;
             else
                 itemIndex = dataGroup.getElementIndex(event.currentTarget as IVisualElement);
-            
+			// The event can be called by an item renderer which has already been removed from the
dataProvider.
+			// In that case, bail out.
+            if(itemIndex < 0 || itemIndex >= dataProvider.length)
+				return;
+			
             var listEvent:ListEvent = new ListEvent(type, false, false,
                                                     event.localX,
                                                     event.localY,


Mime
View raw message