You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by hu...@apache.org on 2025/03/05 14:20:18 UTC

(royale-asjs) branch develop updated: Fixed error in ListAutoSelectFirstIndex bead, when dataProvider changes and there are no elements

This is an automated email from the ASF dual-hosted git repository.

hugoferreira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5d0de70479 Fixed error in ListAutoSelectFirstIndex bead, when dataProvider changes and there are no elements
5d0de70479 is described below

commit 5d0de704796e685ce5eac7ad40325bade01f9c82
Author: Hugo Ferreira <32...@users.noreply.github.com>
AuthorDate: Wed Mar 5 14:20:10 2025 +0000

    Fixed error in ListAutoSelectFirstIndex bead, when dataProvider changes and there are no elements
---
 .../apache/royale/jewel/beads/controls/list/ListAutoSelectFirstIndex.as | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/list/ListAutoSelectFirstIndex.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/list/ListAutoSelectFirstIndex.as
index 85a21d750b..908d697f06 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/list/ListAutoSelectFirstIndex.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/list/ListAutoSelectFirstIndex.as
@@ -71,7 +71,7 @@ package org.apache.royale.jewel.beads.controls.list
 
         private function dataProviderChangedHandler(event:Event):void
         {
-            if (_strand.dataProvider != null && _strand.dataProvider.length > 0)
+            if (_strand.dataProvider != null && _strand.dataProvider.length > 0 && _strand.getElementAt(1) != null)
                 (_strand.getElementAt(1) as ListItemRenderer).dispatchEvent(new Event("click"));
         }
 	}