             modalWindow.name = "modalWindow";
         }
     
-    	if (!sm)
+    	if (!sm && parentReference)
 	        sm = ISystemManager2(IUIComponent(parentReference).systemManager);
 
 		var smp:SystemManagerProxy;

     */
    private var popupInfo:Array;

	// VERSION_SKEW
	private var lastPopupInfo:PopUpData;
	private var systemManagerModal:Boolean;
	
	private var excludeRect:Rectangle;
	private var systemManagerPopped:Boolean;
	
    //--------------------------------------------------------------------------
    //
    //  Methods

    
    /**
     *  @private
     * 
     *  Create the modal window. 
     *  This is called in two different cases.
     *      1. Create a modal window for a local pop up.
     *      2. Create a modal window for a remote pop up. In this case o.owner will be null.
     */
    private function createModalWindow(parentReference:DisplayObject,
                                       o:PopUpData,
                                       childrenList:IChildList,
                                       visibleFlag:Boolean,
                                       sm:ISystemManager2,
                                       sbRoot:DisplayObject):void
    {
        const popup:IFlexDisplayObject = IFlexDisplayObject(o.owner);

        const popupStyleClient:IStyleClient = popup as IStyleClient;
        var duration:Number = 0;
      
        // Create a modalWindow the size of the stage
        // that eats all mouse clicks.
        var modalWindow:Sprite;
