Bug 1004266 - Guard against a possible null outerWindow. rs=smaug