Issue #1514 - Perform validity check before trying to use the content.

Resolves #1514
pull/24/head
wolfbeast 2 years ago committed by Roy Tam
parent 788e24053a
commit de71a9e013
  1. 3
      editor/libeditor/HTMLStyleEditor.cpp

@ -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…
Cancel
Save