         super.data = value;
 
         if (value is TocLegendItem)
-        {
+        {   
+            _legendSwatchContainer.removeAllElements();
+            
             var symbol:Symbol = TocLegendItem(value).legendItemInfo.symbol;
-            if (symbol && !(symbol is CompositeSymbol))
-            {
-                _legendSwatchContainer.removeAllElements();
-                _legendSwatchContainer.addElement(symbol.createSwatch(LEGEND_SWATCH_SIZE, LEGEND_SWATCH_SIZE));
+            if (symbol)
+            {   
+                var swatch:UIComponent = symbol.createSwatch(LEGEND_SWATCH_SIZE, LEGEND_SWATCH_SIZE);
+                if (swatch)
+                {                   
+                    _legendSwatchContainer.addElement(swatch);
+                }
             }
         }
     }


import com.esri.ags.layers.Layer;
import com.esri.ags.layers.TiledMapServiceLayer;
import com.esri.ags.symbols.CompositeSymbol;
import com.esri.ags.symbols.Symbol;
import com.esri.viewer.AppEvent;
import com.esri.viewer.components.toc.TOC;

import mx.controls.treeClasses.TreeItemRenderer;
import mx.controls.treeClasses.TreeListData;
import mx.core.FlexGlobals;
import mx.core.UIComponent;

import spark.components.Group;

