]> git.saurik.com Git - wxWidgets.git/commitdiff
Crash fix for inserting text into a buffer without an associated control
authorJulian Smart <julian@anthemion.co.uk>
Thu, 29 Aug 2013 11:41:48 +0000 (11:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 29 Aug 2013 11:41:48 +0000 (11:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index cc52bc9a105f3d2ffcd78b8263d068d062c91bd2..230a8a4731b8de220223312a1a8479e3af557121 100644 (file)
@@ -7446,7 +7446,10 @@ bool wxRichTextParagraphLayoutBox::InsertParagraphsWithUndo(wxRichTextBuffer* bu
 /// Submit command to insert the given text
 bool wxRichTextBuffer::InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl* ctrl, int flags)
 {
-    return ctrl->GetFocusObject()->InsertTextWithUndo(this, pos, text, ctrl, flags);
+    if (ctrl)
+        return ctrl->GetFocusObject()->InsertTextWithUndo(this, pos, text, ctrl, flags);
+    else
+        return wxRichTextParagraphLayoutBox::InsertTextWithUndo(this, pos, text, ctrl, flags);
 }
 
 /// Submit command to insert the given text