         
         // Obtain reference to newly generated item element which will be used
         // to compute the baseline.
-        var listItem:Object = dataGroup.getElementAt(0);
+        var listItem:Object = dataGroup ? dataGroup.getElementAt(0) : undefined;
         if (!listItem)
             return super.baselinePosition;
         

        if (labelFieldOrFunctionChanged)
        {
        	//Cycle through all instantiated renderers
        	for (var i:int = 0; i < dataGroup.numChildren; i++)
        	{
        		//TODO: Ryan, figure out numChildren/numElement vs. getElement/getChild
        		//and which is more performant. 
        		var renderer:IItemRenderer = dataGroup.getElementAt(i) as IItemRenderer; 
        		//Push the correct text into the renderer by settings its labelText
        		//property 
        		if (renderer)
        		{
        			renderer.labelText = itemToLabel(renderer.data); 
        		}
        	}
        	labelFieldOrFunctionChanged = false; 
        }
    }
    


import mx.collections.IList;
import spark.components.SkinnableDataContainer;
import spark.components.IItemRendererOwner; 
import spark.components.IItemRenderer; 
import mx.core.IVisualElement;
import mx.events.IndexChangedEvent;
