diff --git a/embedding/components/find/src/nsFind.cpp b/embedding/components/find/src/nsFind.cpp index 8c8e6c00546..eee5240040e 100644 --- a/embedding/components/find/src/nsFind.cpp +++ b/embedding/components/find/src/nsFind.cpp @@ -301,6 +301,9 @@ nsFindContentIterator::Reset() range->SetStart(mStartNode, mStartOffset); range->SetEnd(mEndNode, mEndOffset); mOuterIterator->Init(range); + // if there's nothing to search, just return + if (mOuterIterator->IsDone()) + return; if (!mFindBackward) { if (mStartOuterNode != mStartNode) {