Index: Source/core/editing/EditorCommand.cpp |
diff --git a/Source/core/editing/EditorCommand.cpp b/Source/core/editing/EditorCommand.cpp |
index 6ecd44be276a96a5e9428cbf10ae36a637ad72be..1c6a0169c29b4987bf855723dabc989f8a594688 100644 |
--- a/Source/core/editing/EditorCommand.cpp |
+++ b/Source/core/editing/EditorCommand.cpp |
@@ -494,7 +494,8 @@ static bool executeInsertBacktab(Frame& frame, Event* event, EditorCommandSource |
static bool executeInsertHorizontalRule(Frame& frame, Event*, EditorCommandSource, const String& value) |
{ |
- RefPtr<HTMLHRElement> rule = HTMLHRElement::create(frame.document()); |
+ ASSERT(frame.document()); |
+ RefPtr<HTMLHRElement> rule = HTMLHRElement::create(*frame.document()); |
if (!value.isEmpty()) |
rule->setIdAttribute(value); |
return executeInsertNode(frame, rule.release()); |
@@ -508,7 +509,8 @@ static bool executeInsertHTML(Frame& frame, Event*, EditorCommandSource, const S |
static bool executeInsertImage(Frame& frame, Event*, EditorCommandSource, const String& value) |
{ |
// FIXME: If userInterface is true, we should display a dialog box and let the user choose a local image. |
- RefPtr<HTMLImageElement> image = HTMLImageElement::create(frame.document()); |
+ ASSERT(frame.document()); |
+ RefPtr<HTMLImageElement> image = HTMLImageElement::create(*frame.document()); |
image->setSrc(value); |
return executeInsertNode(frame, image.release()); |
} |