Index: Source/core/editing/ReplaceSelectionCommand.cpp |
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp |
index 43d1e195730fe480218b123c03c9c54be652b2d6..40b1c380a54ca46172fc35903e39817d3b08c41f 100644 |
--- a/Source/core/editing/ReplaceSelectionCommand.cpp |
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp |
@@ -518,7 +518,7 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert |
} |
// FIXME: Tolerate differences in id, class, and style attributes. |
- if (isNonTableCellHTMLBlockElement(element) && areIdenticalElements(element, element->parentNode()) |
+ if (element->parentNode() && isNonTableCellHTMLBlockElement(element) && areIdenticalElements(element, element->parentNode()) |
&& VisiblePosition(firstPositionInNode(element->parentNode())) == VisiblePosition(firstPositionInNode(element)) |
&& VisiblePosition(lastPositionInNode(element->parentNode())) == VisiblePosition(lastPositionInNode(element))) { |
insertedNodes.willRemoveNodePreservingChildren(*element); |