mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
fix: crash when clipboard is empty
This commit is contained in:
parent
254eac11a1
commit
68abb2d78b
1 changed files with 3 additions and 3 deletions
|
@ -128,10 +128,10 @@ namespace SourceGit.Views
|
|||
else if (e.Key == Key.V && ((OperatingSystem.IsMacOS() && e.KeyModifiers == KeyModifiers.Meta) || (!OperatingSystem.IsMacOS() && e.KeyModifiers == KeyModifiers.Control)))
|
||||
{
|
||||
var text = await App.GetClipboardTextAsync();
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
text = text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
if (SubjectEditor.CaretIndex == Subject.Length)
|
||||
{
|
||||
var idx = text.IndexOf('\n');
|
||||
|
|
Loading…
Reference in a new issue