From ae7697a8651e0668281144fa89084c99bbfc7dbe Mon Sep 17 00:00:00 2001 From: jwcloverain Date: Thu, 29 Jun 2023 12:08:56 +0800 Subject: [PATCH] add confirmation.Icon null property check --- Steam Desktop Authenticator/ConfirmationFormWeb.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Steam Desktop Authenticator/ConfirmationFormWeb.cs b/Steam Desktop Authenticator/ConfirmationFormWeb.cs index 62112352..2e3c4a52 100644 --- a/Steam Desktop Authenticator/ConfirmationFormWeb.cs +++ b/Steam Desktop Authenticator/ConfirmationFormWeb.cs @@ -64,10 +64,13 @@ private async Task LoadData() e.Graphics.FillRectangle(brush, panel.ClientRectangle); } }; - - PictureBox pictureBox = new PictureBox() { Width = 60, Height = 60, Location = new Point(20, 20), SizeMode = PictureBoxSizeMode.Zoom }; - pictureBox.Load(confirmation.Icon); - panel.Controls.Add(pictureBox); + + 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); + } Label nameLabel = new Label() {