mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 10:50:52 +08:00
fix: crash when clipboard is empty
This commit is contained in:
@@ -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();
|
||||
text = text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
text = text.Trim();
|
||||
|
||||
if (SubjectEditor.CaretIndex == Subject.Length)
|
||||
{
|
||||
var idx = text.IndexOf('\n');
|
||||
|
||||
Reference in New Issue
Block a user