From f2d701a18c7d526e43e66b438d58d16c337649c0 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 25 Oct 2012 14:36:23 +0200 Subject: [PATCH] Bug 802995 - Missing null check in nsTextServicesDocument::DeleteSelection; r=ehsan --- editor/txtsvc/src/nsTextServicesDocument.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/txtsvc/src/nsTextServicesDocument.cpp b/editor/txtsvc/src/nsTextServicesDocument.cpp index 17b47bb7854a..a7a636e648f0 100644 --- a/editor/txtsvc/src/nsTextServicesDocument.cpp +++ b/editor/txtsvc/src/nsTextServicesDocument.cpp @@ -1383,13 +1383,14 @@ nsTextServicesDocument::DeleteSelection() nsCOMPtr 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.