From ddbcda4f0b6ddb64dc3a52f515564c8149c2f7fa Mon Sep 17 00:00:00 2001 From: pvvv <168380676+trulyheartless@users.noreply.github.com> Date: Fri, 11 Apr 2025 13:27:58 -0500 Subject: [PATCH] Slight fix for IconEx.cs double checks the stream position is reset before reading --- Bloxstrap/Extensions/IconEx.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Bloxstrap/Extensions/IconEx.cs b/Bloxstrap/Extensions/IconEx.cs index 516899d..bdb812d 100644 --- a/Bloxstrap/Extensions/IconEx.cs +++ b/Bloxstrap/Extensions/IconEx.cs @@ -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); } }