Skip to content

Commit eed5d11

Browse files
[Fixed] #1034 Multi-Windows Cut Copy crash (#1044)
Co-authored-by: vignesh.govindhan <[email protected]>
1 parent 0a9e730 commit eed5d11

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Files/Interacts/Interaction.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,14 @@ public async void CutItem_Click(object sender, RoutedEventArgs e)
849849
}
850850
dataPackage.SetStorageItems(items);
851851
Clipboard.SetContent(dataPackage);
852-
Clipboard.Flush();
852+
try
853+
{
854+
Clipboard.Flush();
855+
}
856+
catch
857+
{
858+
dataPackage = null;
859+
}
853860
}
854861

855862
public string CopySourcePath;
@@ -887,7 +894,13 @@ public async void CopyItem_ClickAsync(object sender, RoutedEventArgs e)
887894
{
888895
dataPackage.SetStorageItems(items);
889896
Clipboard.SetContent(dataPackage);
890-
Clipboard.Flush();
897+
try
898+
{
899+
Clipboard.Flush();
900+
}
901+
catch {
902+
dataPackage = null;
903+
}
891904
}
892905
}
893906

0 commit comments

Comments
 (0)