ui nullref fix

This commit is contained in:
Marlon 2022-12-16 19:53:34 +01:00
parent 2fea609a63
commit 352386d1fa
No known key found for this signature in database
GPG Key ID: 5C65CA190C38792F
2 changed files with 8 additions and 2 deletions

@ -1 +1 @@
Subproject commit d9c3db37652e615cf7160c168ccdb995171d1947
Subproject commit 00663461bc32e1c0bac12448e2f5c65c78c57dd0

View File

@ -63,6 +63,12 @@ public class TabImage : ViewModel
private void SetImage(SKBitmap bitmap)
{
if (bitmap is null)
{
ImageBuffer = null;
Image = null;
return;
}
_bmp = bitmap;
using var data = _bmp.Encode(NoAlpha ? SKEncodedImageFormat.Jpeg : SKEncodedImageFormat.Png, 100);
using var stream = new MemoryStream(ImageBuffer = data.ToArray(), false);
@ -451,4 +457,4 @@ public class TabControlViewModel : ViewModel
{
yield return new TabItem("New Tab", string.Empty);
}
}
}