diff --git a/extensions/typeaheadfind/src/nsTypeAheadFind.cpp b/extensions/typeaheadfind/src/nsTypeAheadFind.cpp index b941532d2e0..c64e33e64dc 100644 --- a/extensions/typeaheadfind/src/nsTypeAheadFind.cpp +++ b/extensions/typeaheadfind/src/nsTypeAheadFind.cpp @@ -1649,7 +1649,7 @@ nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange, if (parent) { nsIContent *parentsFirstChild = parent->GetChildAt(0); // We don't want to look at a whitespace-only first child - if (parentsFirstChild->TextIsOnlyWhitespace()) + if (parentsFirstChild && parentsFirstChild->TextIsOnlyWhitespace()) parentsFirstChild = parent->GetChildAt(1); if (parentsFirstChild != startContent) { diff --git a/toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp b/toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp index 72088e385b4..6d0b9d038ee 100755 --- a/toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp +++ b/toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp @@ -852,7 +852,7 @@ nsTypeAheadFind::RangeStartsInsideLink(nsIDOMRange *aRange, nsIContent *parentsFirstChild = parent->GetChildAt(0); // We don't want to look at a whitespace-only first child - if (parentsFirstChild->TextIsOnlyWhitespace()) { + if (parentsFirstChild && parentsFirstChild->TextIsOnlyWhitespace()) { parentsFirstChild = parent->GetChildAt(1); }