b=482439 don't risk dereferencing a possibly-null pointer in nsDocument::ElementFromPointHelper r=smaug

This commit is contained in:
Jonathan Kew 2009-03-11 15:23:10 +13:00
parent 2e14d4895d
commit c3f0eac9a5

View File

@ -2672,8 +2672,8 @@ nsDocument::ElementFromPointHelper(PRInt32 aX, PRInt32 aY,
// or a node that isn't an element (such as a text frame node),
// replace it with the first non-anonymous parent node of type element.
while (ptContent &&
!ptContent->IsNodeOfType(nsINode::eELEMENT) ||
ptContent->IsInAnonymousSubtree()) {
(!ptContent->IsNodeOfType(nsINode::eELEMENT) ||
ptContent->IsInAnonymousSubtree())) {
// XXXldb: Faster to jump to GetBindingParent if non-null?
ptContent = ptContent->GetParent();
}