Fix Linux crash on nsnull pointer as part of blocker 123572 r=danm a=radha sr=sfraser

This commit is contained in:
locka%iol.ie 2002-02-05 23:26:51 +00:00
parent fea8c2b1e0
commit 527087c717
2 changed files with 11 additions and 9 deletions

View File

@ -1441,18 +1441,20 @@ void nsWebShellWindow::LoadContentAreas() {
// see if we have a webshell with a matching contentAreaID
nsCOMPtr<nsIDocShellTreeItem> content;
rv = GetContentShellById(contentAreaID.get(), getter_AddRefs(content));
if (NS_SUCCEEDED(rv)) {
urlChar = ToNewCString(contentURL);
if (urlChar) {
nsUnescape(urlChar);
contentURL.AssignWithConversion(urlChar);
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(content));
webNav->LoadURI(contentURL.get(),
if (NS_SUCCEEDED(rv) && content) {
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(content));
if (webNav) {
urlChar = ToNewCString(contentURL);
if (urlChar) {
nsUnescape(urlChar);
contentURL.AssignWithConversion(urlChar);
webNav->LoadURI(contentURL.get(),
nsIWebNavigation::LOAD_FLAGS_NONE,
nsnull,
nsnull,
nsnull);
nsMemory::Free(urlChar);
nsMemory::Free(urlChar);
}
}
}
}

View File

@ -231,7 +231,7 @@ NS_IMETHODIMP nsXULWindow::GetContentShellById(const PRUnichar* aID,
return NS_OK;
}
}
return NS_OK;
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsXULWindow::AddChildWindow(nsIXULWindow *aChild)