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