Bug 802995 - Missing null check in nsTextServicesDocument::DeleteSelection; r=ehsan

This commit is contained in:
Aryeh Gregor 2012-10-25 14:36:23 +02:00
parent 2afd934910
commit f2d701a18c

View File

@ -1383,13 +1383,14 @@ nsTextServicesDocument::DeleteSelection()
nsCOMPtr<nsIContent> curContent;
if (mIteratorStatus != nsTextServicesDocument::eIsDone &&
mIterator->GetCurrentNode()->IsContent()) {
if (mIteratorStatus != nsTextServicesDocument::eIsDone) {
// The old iterator is still pointing to something valid,
// so get its current node so we can restore it after we
// create the new iterator!
curContent = mIterator->GetCurrentNode()->AsContent();
curContent = mIterator->GetCurrentNode()
? mIterator->GetCurrentNode()->AsContent()
: nullptr;
}
// Create the new iterator.