Skip to content

Commit

Permalink
ConfigApp: Fix Workshop tab crash on non-Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Jan 28, 2025
1 parent cd8c551 commit cb9e016
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ConfigApp/WorkshopSubmissionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,16 @@ public WorkshopSubmissionItem()
var fileName = Process.GetCurrentProcess().MainModule?.FileName;
if (fileName is not null)
{
using var ico = Icon.ExtractAssociatedIcon(fileName);
if (ico is not null)
ms_DefaultIcon = Imaging.CreateBitmapSourceFromHIcon(ico.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
try
{
using var ico = Icon.ExtractAssociatedIcon(fileName);
if (ico is not null)
ms_DefaultIcon = Imaging.CreateBitmapSourceFromHIcon(ico.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
}
catch (System.PlatformNotSupportedException)
{

}
}
}

Expand Down

0 comments on commit cb9e016

Please sign in to comment.