From: Vadim Zeitlin Date: Sun, 15 Jun 2008 11:45:05 +0000 (+0000) Subject: fix crash when copying empty selection to clipboard (#4783) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0c9a7985470910831dad4c8c5c1b9c326eac1a54 fix crash when copying empty selection to clipboard (#4783) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index b68bde05d3..3f2b272c81 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -523,6 +523,9 @@ void ScintillaWX::Paste() { void ScintillaWX::CopyToClipboard(const SelectionText& st) { #if wxUSE_CLIPBOARD + if ( !st.len ) + return; + wxTheClipboard->UsePrimarySelection(false); if (wxTheClipboard->Open()) { wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));