Slight fix for IconEx.cs

double checks the stream position is reset before reading
This commit is contained in:
pvvv 2025-04-11 13:27:58 -05:00 committed by GitHub
parent 1f21e8ce0b
commit ddbcda4f0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
using System.Drawing;
using System.Drawing;
using System.IO;
using System.Windows.Media.Imaging;
using System.Windows.Media;
@ -12,6 +13,7 @@ namespace Bloxstrap.Extensions
{
using MemoryStream stream = new();
icon.Save(stream);
stream.Seek(0, SeekOrigin.Begin);
if (handleException)
{
@ -22,7 +24,7 @@ namespace Bloxstrap.Extensions
catch (Exception ex)
{
App.Logger.WriteException("IconEx::GetImageSource", ex);
Frontend.ShowMessageBox(String.Format(Strings.Dialog_IconLoadFailed, ex.Message));
Frontend.ShowMessageBox(string.Format(Strings.Dialog_IconLoadFailed, ex.Message));
return BootstrapperIcon.IconBloxstrap.GetIcon().GetImageSource(false);
}
}