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

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

        // reset to the first item if requiresSelection is true)
        if (index == selectedIndex)
        {
            if (requiresSelection && dataProvider && dataProvider.length > 0)
                selectedIndex = 0;
            else
                selectedIndex = -1;
