diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 9b40064ee8..9d98c4fe64 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -3244,7 +3244,8 @@ void wxRichTextCtrl::Replace(long from, long to, SetDefaultStyle(attr); - DoWriteText(value, SetValue_SelectionOnly); + if (!value.IsEmpty()) + DoWriteText(value, SetValue_SelectionOnly); EndBatchUndo(); }