]> git.saurik.com Git - wxWidgets.git/commitdiff
fix crash when copying empty selection to clipboard (#4783)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 15 Jun 2008 11:45:05 +0000 (11:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 15 Jun 2008 11:45:05 +0000 (11:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/stc/ScintillaWX.cpp

index b68bde05d30cccff3badc7f658844e2716f2782b..3f2b272c819b71d26b715e435631de81477cd2e5 100644 (file)
@@ -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));