     protected function focusOutHandler(event:FocusEvent):void
     {
         // By default, we clear the undo history when a TextView loses focus.
-        if (mx_internal::clearUndoOnFocusOut)
-                mx_internal::undoManager.clearAll();
+        if (mx_internal::clearUndoOnFocusOut && mx_internal::undoManager)
+            mx_internal::undoManager.clearAll();
                     
         if (focusManager)
             focusManager.defaultButtonEnabled = true;

            else if (category == Category.CHARACTER && characterFormat)
                format[p] = characterFormat[p];
        }
        
        // Restore the prior editing mode.
        editingMode = priorEditingMode;

 *  @productversion Flex 4
 */
public class RichEditableText extends TextBaseClassWithStylesAndFocus
	implements IViewport, IFontContextComponent, IIMESupport
{
    include "../core/Version.as";
        
