mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-04 20:46:29 +03:00
Should fix crash on copy paste if the pasted text is an empty string.
This commit is contained in:
@@ -1760,7 +1760,8 @@ void TextDocument::pasteText( String&& text ) {
|
||||
if ( text.find_first_of( '\r' ) != String::InvalidPos )
|
||||
String::replaceAll( text, "\r", "" );
|
||||
|
||||
if ( std::count( text.begin(), text.end(), '\n' ) ==
|
||||
if ( !text.empty() &&
|
||||
std::count( text.begin(), text.end(), '\n' ) ==
|
||||
static_cast<Int64>( mSelection.size() ) - 1 &&
|
||||
text.back() != '\n' ) {
|
||||
std::vector<String> textLines = text.split( '\n', true, false );
|
||||
|
||||
Reference in New Issue
Block a user