Bug 372247, crash simulating key events on a window with no frame, r+sr=roc

This commit is contained in:
enndeakin%sympatico.ca 2007-03-02 03:57:16 +00:00
parent 3d6d15d00a
commit 794743a7b5

View File

@ -261,8 +261,11 @@ nsDOMWindowUtils::GetWidget()
if (docShell) {
nsCOMPtr<nsIPresShell> presShell;
docShell->GetPresShell(getter_AddRefs(presShell));
if (presShell)
return presShell->GetRootFrame()->GetWindow();
if (presShell) {
nsIFrame* frame = presShell->GetRootFrame();
if (frame)
return frame->GetWindow();
}
}
}