         {
             titleDisplay.text = title;
             
-            if (titleGroup && !titleContent)
+            if ((titleGroup && !titleContent)
+                && (titleDisplay is IVisualElement))
             {
                 titleGroup.mxmlContent = [titleDisplay];
             }

import mx.utils.BitFlagUtil;

import spark.components.supportClasses.SkinnableComponent;
import spark.layouts.supportClasses.LayoutBase;

use namespace mx_internal;

            
            var newContentGroupProperties:uint = 0;
            
            if (contentGroupProperties[index].content !== undefined)
            {
                group.mxmlContent = contentGroupProperties[index].content;
                newContentGroupProperties = BitFlagUtil.update(newContentGroupProperties, 
