Crash when running some editing related tests
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 22:50:33 +0000 (22:50 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 22:50:33 +0000 (22:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=84091

Reviewed by Andreas Kling.

Null check triggeringEvent.

* editing/Editor.cpp:
(WebCore::Editor::insertTextWithoutSendingTextEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114311 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.cpp

index 9bc19b8..41d1041 100644 (file)
@@ -1,3 +1,15 @@
+2012-04-16  Anders Carlsson  <andersca@apple.com>
+
+        Crash when running some editing related tests
+        https://bugs.webkit.org/show_bug.cgi?id=84091
+
+        Reviewed by Andreas Kling.
+
+        Null check triggeringEvent.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::insertTextWithoutSendingTextEvent):
+
 2012-04-16  Simon Fraser  <simon.fraser@apple.com>
 
         Rename to updateZOrderListsSlowCase to rebuildZOrderLists
index 22884fa..294eb94 100644 (file)
@@ -916,7 +916,7 @@ bool Editor::insertTextWithoutSendingTextEvent(const String& text, bool selectIn
             RefPtr<Document> document = selectionStart->document();
 
             // Insert the text
-            if (triggeringEvent->isDictation())
+            if (triggeringEvent && triggeringEvent->isDictation())
                 DictationCommand::insertText(document.get(), text, triggeringEvent->dictationAlternatives(), selection);
             else {
                 TypingCommand::Options options = 0;