diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 12b8a8d79c3..d63267a7185 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -2855,6 +2855,10 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer) nsCOMPtr widget; NS_ENSURE_SUCCESS(GetMainWidget(getter_AddRefs(widget)), NS_ERROR_FAILURE); + if (!widget) { + NS_ERROR("GetMainWidget coughed up a null widget"); + return NS_ERROR_FAILURE; + } nsRect bounds(x, y, cx, cy); NS_ENSURE_SUCCESS(EnsureDeviceContext(), NS_ERROR_FAILURE);