diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index c89c318b5bd..f2df548db67 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -1361,12 +1361,13 @@ NS_IMETHODIMP nsWebShell::GetTopLevelWindow(nsIWebShellContainer** aTopLevelWindow) { NS_ENSURE_ARG_POINTER(aTopLevelWindow); - *aTopLevelWindow; + *aTopLevelWindow = nsnull; nsCOMPtr rootWebShell; GetRootWebShellEvenIfChrome(getter_AddRefs(rootWebShell)); - NS_ENSURE_TRUE(rootWebShell, NS_OK); + if(!rootWebShell) + return NS_OK; nsCOMPtr rootContainer; rootWebShell->GetContainer(*aTopLevelWindow); diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index c89c318b5bd..f2df548db67 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -1361,12 +1361,13 @@ NS_IMETHODIMP nsWebShell::GetTopLevelWindow(nsIWebShellContainer** aTopLevelWindow) { NS_ENSURE_ARG_POINTER(aTopLevelWindow); - *aTopLevelWindow; + *aTopLevelWindow = nsnull; nsCOMPtr rootWebShell; GetRootWebShellEvenIfChrome(getter_AddRefs(rootWebShell)); - NS_ENSURE_TRUE(rootWebShell, NS_OK); + if(!rootWebShell) + return NS_OK; nsCOMPtr rootContainer; rootWebShell->GetContainer(*aTopLevelWindow);