mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Slight fix for IconEx.cs
double checks the stream position is reset before reading
This commit is contained in:
parent
1f21e8ce0b
commit
ddbcda4f0b
@ -1,4 +1,5 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ namespace Bloxstrap.Extensions
|
|||||||
{
|
{
|
||||||
using MemoryStream stream = new();
|
using MemoryStream stream = new();
|
||||||
icon.Save(stream);
|
icon.Save(stream);
|
||||||
|
stream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
if (handleException)
|
if (handleException)
|
||||||
{
|
{
|
||||||
@ -22,7 +24,7 @@ namespace Bloxstrap.Extensions
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
App.Logger.WriteException("IconEx::GetImageSource", 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);
|
return BootstrapperIcon.IconBloxstrap.GetIcon().GetImageSource(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user