Perform validity check before trying to use the content.
This commit is contained in:
parent
66e78cb6b8
commit
66da77ec41
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue