From 0c9a7985470910831dad4c8c5c1b9c326eac1a54 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 15 Jun 2008 11:45:05 +0000 Subject: [PATCH 1/1] 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 --- src/stc/ScintillaWX.cpp | 3 +++ 1 file changed, 3 insertions(+) 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)); -- 2.45.2