From 6245e5a8f2a5b925e52b4eb4aaa3a2f91408344e Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 13 Apr 2020 12:57:07 +0200 Subject: Issue #1514 - Perform validity check before trying to use the content. Resolves #1514 --- editor/libeditor/HTMLStyleEditor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'editor') diff --git a/editor/libeditor/HTMLStyleEditor.cpp b/editor/libeditor/HTMLStyleEditor.cpp index bc7141ad33..6a1ffe8b41 100644 --- a/editor/libeditor/HTMLStyleEditor.cpp +++ b/editor/libeditor/HTMLStyleEditor.cpp @@ -333,8 +333,9 @@ HTMLEditor::SetInlinePropertyOnTextNode(Text& aText, RefPtr 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) { -- cgit v1.2.3