Skip to content

Commit 75ca113

Browse files
committed
Optimize logic
1 parent 5d97a0b commit 75ca113

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

src/SignToolGUI/Forms/MainForm.cs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -524,19 +524,12 @@ private void RadioButtonSelectCertificateLocation_CheckedChanged(object sender,
524524
var certificate = GetCertificateFromPfx();
525525

526526
// If the label for certificate information is not null, update it with the certificate info.
527-
if (labelCertificateInformation != null)
528-
{
529-
if (certificate != null)
530-
{
531-
// If the certificate is successfully retrieved, update the label with its info.
532-
labelCertificateInformation.Text = GetCertificateInfo(certificate);
533-
}
534-
else
535-
{
536-
// If the certificate could not be retrieved, set the label to indicate this.
537-
labelCertificateInformation.Text = Globals.DigitalCertificates.CertificateInfoCouldNotBeRetrieved;
538-
}
539-
}
527+
if (labelCertificateInformation == null) return;
528+
529+
// If the certificate is successfully retrieved, update the label with its info.
530+
labelCertificateInformation.Text = certificate != null ? GetCertificateInfo(certificate) :
531+
// If the certificate could not be retrieved, set the label to indicate this.
532+
Globals.DigitalCertificates.CertificateInfoCouldNotBeRetrieved;
540533
}
541534
}
542535
catch (Exception ex)

0 commit comments

Comments
 (0)