diff --git a/editor/libeditor/crashtests/1134545.html b/editor/libeditor/crashtests/1134545.html new file mode 100644 index 00000000000..4e871804ff0 --- /dev/null +++ b/editor/libeditor/crashtests/1134545.html @@ -0,0 +1,22 @@ + + + + + + +
+ + + \ No newline at end of file diff --git a/editor/libeditor/crashtests/crashtests.list b/editor/libeditor/crashtests/crashtests.list index 4c78bae5ec8..03b93903e53 100644 --- a/editor/libeditor/crashtests/crashtests.list +++ b/editor/libeditor/crashtests/crashtests.list @@ -59,3 +59,4 @@ load 772282.html load 776323.html needs-focus load 793866.html load 1057677.html +load 1134545.html diff --git a/editor/libeditor/nsHTMLEditorStyle.cpp b/editor/libeditor/nsHTMLEditorStyle.cpp index 83065f1ef43..7a087f0fa29 100644 --- a/editor/libeditor/nsHTMLEditorStyle.cpp +++ b/editor/libeditor/nsHTMLEditorStyle.cpp @@ -1527,10 +1527,10 @@ nsHTMLEditor::RelativeFontChange( int32_t aSizeChange) int32_t offset; nsCOMPtr selectedNode; GetStartNodeAndOffset(selection, getter_AddRefs(selectedNode), &offset); - NS_ENSURE_TRUE(selectedNode, NS_OK); - if (IsTextNode(selectedNode)) { + if (selectedNode && IsTextNode(selectedNode)) { selectedNode = selectedNode->GetParentNode(); } + NS_ENSURE_TRUE(selectedNode, NS_OK); if (!CanContainTag(*selectedNode, *atom)) { return NS_OK; }