Index: Source/core/page/DragController.cpp |
diff --git a/Source/core/page/DragController.cpp b/Source/core/page/DragController.cpp |
index 6e2df1bae62ce55fe86bf077e0c78663e59b6a1a..6b0b9b7b6413d798d52c2173f4aa588d86a46ec6 100644 |
--- a/Source/core/page/DragController.cpp |
+++ b/Source/core/page/DragController.cpp |
@@ -507,7 +507,8 @@ bool DragController::concludeEditDrag(DragData* dragData) |
options |= ReplaceSelectionCommand::SmartReplace; |
if (chosePlainText) |
options |= ReplaceSelectionCommand::MatchStyle; |
- applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse.get(), fragment, options)); |
+ ASSERT(m_documentUnderMouse); |
+ applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse.get(), fragment, options)); |
} |
} |
} else { |
@@ -516,8 +517,10 @@ bool DragController::concludeEditDrag(DragData* dragData) |
return false; |
} |
- if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point)) |
- applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse.get(), createFragmentFromText(range.get(), text), ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting)); |
+ if (setSelectionToDragCaret(innerFrame.get(), dragCaret, range, point)) { |
+ ASSERT(m_documentUnderMouse); |
+ applyCommand(ReplaceSelectionCommand::create(*m_documentUnderMouse.get(), createFragmentFromText(range.get(), text), ReplaceSelectionCommand::SelectReplacement | ReplaceSelectionCommand::MatchStyle | ReplaceSelectionCommand::PreventNesting)); |
+ } |
} |
if (rootEditableElement) { |