             
             if (requiresSelection &&
                     selectedIndex == NO_SELECTION &&
+                    dataProvider &&
                     dataProvider.length > 0)
             {
             	// Set the proposed selected index here to make sure

    {
    	doingWholesaleChanges = false;
    	
    	if (selectedIndex >= 0 && selectedIndex < dataProvider.length)
    	   itemSelected(dataProvider.getItemAt(selectedIndex), true);
    	else
    	   selectedIndex = -1;
    	   
    	dataProvider.addEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler);
    }
    
    protected function collectionChangeHandler(event:Event):void

     */
    private function dataProviderChangingHandler(event:FlexEvent):void
    {
        if (dataProvider)
            dataProvider.removeEventListener(CollectionEvent.COLLECTION_CHANGE, collectionChangeHandler);
        
    	doingWholesaleChanges = true;
    }
