Skip to content

Commit

Permalink
Fix PlayCorrespondingSystemSound FileNotFoundException crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Klocman committed May 15, 2023
1 parent 2b90f32 commit 5ad1671
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions source/KlocTools/Forms/CustomMessageBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,15 @@ private CustomMessageBox(CmbBasicSettings settings, CmbCheckboxSettings checkbox

if (settings.IconSet != null)
{
pictureBox1.Image = settings.IconSet.ToBitmap();
settings.IconSet.PlayCorrespondingSystemSound();
try
{
pictureBox1.Image = settings.IconSet.ToBitmap();
settings.IconSet.PlayCorrespondingSystemSound();
}
catch (SystemException e)
{
Console.WriteLine(e);
}
}

TopMost = settings.AlwaysOnTop;
Expand Down

0 comments on commit 5ad1671

Please sign in to comment.