diff --git a/mozilla/dom/src/base/nsDOMWindowUtils.cpp b/mozilla/dom/src/base/nsDOMWindowUtils.cpp index 39fe82c23c2..3ef48b5c73a 100644 --- a/mozilla/dom/src/base/nsDOMWindowUtils.cpp +++ b/mozilla/dom/src/base/nsDOMWindowUtils.cpp @@ -261,8 +261,11 @@ nsDOMWindowUtils::GetWidget() if (docShell) { nsCOMPtr presShell; docShell->GetPresShell(getter_AddRefs(presShell)); - if (presShell) - return presShell->GetRootFrame()->GetWindow(); + if (presShell) { + nsIFrame* frame = presShell->GetRootFrame(); + if (frame) + return frame->GetWindow(); + } } }