diff --git a/toolkit/components/satchel/src/nsFormFillController.cpp b/toolkit/components/satchel/src/nsFormFillController.cpp index 0f3deab89d45..71df97e774d5 100644 --- a/toolkit/components/satchel/src/nsFormFillController.cpp +++ b/toolkit/components/satchel/src/nsFormFillController.cpp @@ -220,8 +220,10 @@ nsFormFillController::SetPopupOpen(PRBool aPopupOpen) // make sure input field is visible before showing popup (bug 320938) nsCOMPtr content = do_QueryInterface(mFocusedInput); nsCOMPtr docShell = GetDocShellForInput(mFocusedInput); + NS_ENSURE_STATE(docShell); nsCOMPtr presShell; docShell->GetPresShell(getter_AddRefs(presShell)); + NS_ENSURE_STATE(presShell); nsIFrame *frame = presShell->GetPrimaryFrameFor(content.get()); if (frame) presShell->ScrollFrameIntoView(frame,