diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-13 12:57:07 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 13:28:28 +0200 |
commit | 3cb245b74961f6954b8146de67fbaca870d43656 (patch) | |
tree | c6bea12c2ce6eb04fa61433c9bc8d39493d6e504 | |
parent | 9f5529d1e7374ee3ed186958c8cf192e88b7405d (diff) | |
download | UXP-3cb245b74961f6954b8146de67fbaca870d43656.tar UXP-3cb245b74961f6954b8146de67fbaca870d43656.tar.gz UXP-3cb245b74961f6954b8146de67fbaca870d43656.tar.lz UXP-3cb245b74961f6954b8146de67fbaca870d43656.tar.xz UXP-3cb245b74961f6954b8146de67fbaca870d43656.zip |
Issue #1514 - Perform validity check before trying to use the content.
Resolves #1514
-rw-r--r-- | editor/libeditor/HTMLStyleEditor.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/libeditor/HTMLStyleEditor.cpp b/editor/libeditor/HTMLStyleEditor.cpp index bc7141ad3..6a1ffe8b4 100644 --- a/editor/libeditor/HTMLStyleEditor.cpp +++ b/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) { |