Add trycatch for player bmp loading

Closes #98
This commit is contained in:
Kurt 2020-04-22 22:28:26 -07:00
parent 6f4d9e163c
commit 7a78154ed6

View File

@ -240,9 +240,16 @@ private void LoadPlayer(int index)
NUD_NookMiles.Value = Math.Min(int.MaxValue, pers.NookMiles.Value);
NUD_Wallet.Value = Math.Min(int.MaxValue, pers.Wallet.Value);
var photo = pers.GetPhotoData();
var bmp = new Bitmap(new MemoryStream(photo));
PB_Player.Image = bmp;
try
{
var photo = pers.GetPhotoData();
PB_Player.Image = new Bitmap(new MemoryStream(photo));
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
PlayerIndex = index;
}