X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc63fb9aafcdebf0e5ed04c768457bf61148af0c..fe7cefd493837b49e8095b87aad1a01679eb7592:/src/richtext/richtextbuffer.cpp diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index cc52bc9a10..230a8a4731 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -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