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

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

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