flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [04/14] git commit: fix bug when selectedIndex == -1
Date Thu, 21 Mar 2013 22:24:26 GMT
fix bug when selectedIndex == -1


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

Branch: refs/heads/develop
Commit: 4f9c1ddcb0b07fc159c13b24ff567a1aa793c4a2
Parents: 120b06d
Author: Alex Harui <aharui@apache.org>
Authored: Tue Mar 19 12:24:10 2013 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Mar 19 12:24:10 2013 -0700

----------------------------------------------------------------------
 .../flex/html/staticControls/beads/ListBead.as     |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4f9c1ddc/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as
index 9f7abab..06390e8 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/ListBead.as
@@ -94,8 +94,11 @@ package org.apache.flex.html.staticControls.beads
 				var ir:IItemRenderer = dataGroup.getItemRendererForIndex(lastSelectedIndex) as IItemRenderer;
                 ir.selected = false;
 			}
-            ir = dataGroup.getItemRendererForIndex(listModel.selectedIndex);
-            ir.selected = true;
+			if (listModel.selectedIndex != -1)
+			{
+	            ir = dataGroup.getItemRendererForIndex(listModel.selectedIndex);
+	            ir.selected = true;
+			}
             lastSelectedIndex = listModel.selectedIndex;
 		}
 			


Mime
View raw message