Crash fix for inserting text into a buffer without an associated control

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2013-08-29 11:41:48 +00:00
parent 873194f845
commit fca66f5985

View 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