     override public function get typicalLayoutElement():ILayoutElement
     {
         if (explicitTypicalLayoutElement == null)
-            typicalLayoutElement = getTypicalItemRenderer();
-
+        {
+            if ((typicalLayoutElement = getTypicalItemRenderer()) == null)
+                return null;
+        }
+        
+        // Don't call this unless we know we've set it so that it doesn't
+        // generate one using the target.
         return super.typicalLayoutElement;
     }
 

        {
            const columns:IList = grid.columns;
            const numColumns:int = columns ? columns.length : 0;
            var columnCount:int;
            for (var i:int = 0; i < numColumns; i++)
            {
                var c:GridColumn = columns.getItemAt(i) as GridColumn;
                if (c && c.visible)
                    columnCount ++;
            }
            
            const defaultColumnWidth:Number = 
                typicalLayoutElement.getPreferredBoundsWidth();
            const columnGap:Number = gridDimensions.columnGap;
            
            measuredWidth = (columnCount * (defaultColumnWidth + columnGap)) - columnGap;         
        }
        
        if (!isNaN(grid.explicitHeight))

        if (!grid)
            return;
        
        var measuredWidth:Number = 0;
        var measuredHeight:Number = 0;

        if (!isNaN(grid.explicitWidth))
        {
