Skip to content

Commit

Permalink
Catch exceptions when loading avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
Jessecar96 committed Oct 15, 2024
1 parent 6d38a53 commit 25242f7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Steam Desktop Authenticator/ConfirmationFormWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,19 @@ private async Task LoadData()
e.Graphics.FillRectangle(brush, panel.ClientRectangle);
}
};

if (!string.IsNullOrEmpty(confirmation.Icon))
{
PictureBox pictureBox = new PictureBox() { Width = 60, Height = 60, Location = new Point(20, 20), SizeMode = PictureBoxSizeMode.Zoom };
pictureBox.Load(confirmation.Icon);
panel.Controls.Add(pictureBox);
PictureBox pictureBox = new PictureBox() { Width = 60, Height = 60, Location = new Point(20, 20), SizeMode = PictureBoxSizeMode.Zoom };
try
{
pictureBox.Load(confirmation.Icon);
}
catch (Exception ex)
{
Console.WriteLine("Failed to load avatar: " + ex.Message);
}
panel.Controls.Add(pictureBox);
}

Label nameLabel = new Label()
Expand Down

0 comments on commit 25242f7

Please sign in to comment.