Bug 888602 - Add null-check in mozInlineSpellChecker::ReplaceWord. r=ehsan
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -940,17 +940,18 @@ mozInlineSpellChecker::ReplaceWord(nsIDO
nsCOMPtr<nsISelection> selection;
res = editor->GetSelection(getter_AddRefs(selection));
NS_ENSURE_SUCCESS(res, res);
selection->RemoveAllRanges();
selection->AddRange(range);
editor->DeleteSelection(nsIEditor::eNone, nsIEditor::eStrip);
nsCOMPtr<nsIPlaintextEditor> textEditor(do_QueryReferent(mEditor));
- textEditor->InsertText(newword);
+ if (textEditor)
+ textEditor->InsertText(newword);
editor->EndTransaction();
}
return NS_OK;
}
// mozInlineSpellChecker::AddWordToDictionary