Skip to content

Commit

Permalink
Fix crash due to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenquyhy committed Jun 15, 2022
1 parent 0c43636 commit 8afa0db
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion FlightRecorder.Client/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,15 @@ private void TextBlock_MouseUp(object sender, System.Windows.Input.MouseButtonEv
{
if (sender is TextBlock textBlock)
{
Clipboard.SetText(textBlock.Text);
try
{
Clipboard.SetText(textBlock.Text);
}
catch (Exception ex)
{
logger.LogWarning(ex, "Cannot access clipboard!");
MessageBox.Show("Cannot access clipboard!", "Flight Recorder", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
}

Expand Down

0 comments on commit 8afa0db

Please sign in to comment.