Bug 608662 - fix X-Frame-Options crash when using external view-source editor, r=jst, a=blocking2.0

This commit is contained in:
Brandon Sterne 2010-11-05 09:33:26 -07:00
parent 5e64baf9cf
commit 9e90c6afc8

View File

@ -303,6 +303,10 @@ bool nsDSURIContentListener::CheckFrameOptions(nsIRequest* request)
// document must be same-origin with top window. X-F-O: DENY requires that
// the document must never be framed.
nsCOMPtr<nsIDOMWindow> thisWindow = do_GetInterface(static_cast<nsIDocShell*>(mDocShell));
// If we don't have DOMWindow there is no risk of clickjacking
if (!thisWindow)
return true;
nsCOMPtr<nsIDOMWindow> topWindow;
thisWindow->GetTop(getter_AddRefs(topWindow));