From 806720f7ae71368f4d47ea667dc72da4130b403b Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Wed, 26 Jul 2006 22:02:23 +0000 Subject: [PATCH] Bug 345670: fix crash in nsTypeAheadFind::RangeStartsInsideLink, patch by Adam Guthrie , r+sr=sicking --- extensions/typeaheadfind/src/nsTypeAheadFind.cpp | 2 +- toolkit/components/typeaheadfind/src/nsTypeAheadFind.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); }