Checking in null check and assertion to handle the crashing on imagemap part of the Mac regression.

This commit is contained in:
joki%netscape.com 1999-02-06 02:07:49 +00:00
Родитель 8575f082e8
Коммит 7a1bff7611
2 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -833,8 +833,13 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
docURL = doc->GetDocumentURL();
NS_RELEASE(doc);
}
PRBool inside = map->IsInside(x, y, docURL, absURL, target, altText,
NS_ASSERTION(nsnull != docURL, "nsIDocument->GetDocumentURL() returning nsnull");
PRBool inside = PR_FALSE;
if (nsnull != docURL) {
inside = map->IsInside(x, y, docURL, absURL, target, altText,
&suppress);
}
NS_IF_RELEASE(docURL);
if (inside) {
// We hit a clickable area. Time to go somewhere...

Просмотреть файл

@ -833,8 +833,13 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext,
docURL = doc->GetDocumentURL();
NS_RELEASE(doc);
}
PRBool inside = map->IsInside(x, y, docURL, absURL, target, altText,
NS_ASSERTION(nsnull != docURL, "nsIDocument->GetDocumentURL() returning nsnull");
PRBool inside = PR_FALSE;
if (nsnull != docURL) {
inside = map->IsInside(x, y, docURL, absURL, target, altText,
&suppress);
}
NS_IF_RELEASE(docURL);
if (inside) {
// We hit a clickable area. Time to go somewhere...