Perform validity check before trying to use the content.

This commit is contained in:
Fedor 2020-05-07 14:45:34 +03:00
parent 66e78cb6b8
commit 66da77ec41
1 changed files with 2 additions and 1 deletions

View File

@ -333,8 +333,9 @@ HTMLEditor::SetInlinePropertyOnTextNode(Text& aText,
RefPtr<Text> text = &aText;
if (uint32_t(aEndOffset) != aText.Length()) {
// We need to split off back of text node
text = SplitNode(aText, aEndOffset, rv)->GetAsText();
nsIContent* textNode = SplitNode(aText, aEndOffset, rv);
NS_ENSURE_TRUE(!rv.Failed(), rv.StealNSResult());
text = textNode->GetAsText();
}
if (aStartOffset) {