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
parent 3920c99302
commit 9c87fd97f8
2 changed files with 14 additions and 4 deletions

View File

@@ -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...

View File

@@ -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...