diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 7aba778f889f..fd99ab34b463 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -833,8 +833,13 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext, docURL = doc->GetDocumentURL(); NS_RELEASE(doc); } - PRBool inside = map->IsInside(x, y, docURL, absURL, target, altText, - &suppress); + + 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... diff --git a/layout/html/base/src/nsImageFrame.cpp b/layout/html/base/src/nsImageFrame.cpp index 7aba778f889f..fd99ab34b463 100644 --- a/layout/html/base/src/nsImageFrame.cpp +++ b/layout/html/base/src/nsImageFrame.cpp @@ -833,8 +833,13 @@ nsImageFrame::HandleEvent(nsIPresContext& aPresContext, docURL = doc->GetDocumentURL(); NS_RELEASE(doc); } - PRBool inside = map->IsInside(x, y, docURL, absURL, target, altText, - &suppress); + + 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...