Skip to content

Commit aacf552

Browse files
committed
fix NRE
1 parent 5ef39c2 commit aacf552

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/BenchmarksApps/TLS/HttpSys/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// endpoints
2121
var listeningEndpoints = builder.Configuration["urls"] ?? "https://localhost:5000/";
22-
var httpsIpPort = listeningEndpoints.Split(";").First(x => x.Contains("https")).Replace("https://", "");
22+
var httpsIpPort = listeningEndpoints.Split(";").FirstOrDefault(x => x.Contains("https"))?.Replace("https://", "");
2323

2424
// debug
2525
var writeCertValidationEventsToConsole = bool.TryParse(builder.Configuration["certValidationConsoleEnabled"], out var certValidationConsoleEnabled) && certValidationConsoleEnabled;
@@ -29,7 +29,7 @@
2929
if (!httpOnly)
3030
{
3131
var sslCertConfiguration = NetshConfigurator.PreConfigureNetsh(
32-
httpsIpPort,
32+
httpsIpPort!,
3333
certPublicKeyLength: certPublicKeyLength,
3434
clientCertNegotiation: mTlsEnabled ? NetShFlag.Enable : NetShFlag.Disabled,
3535
disablesessionid: NetShFlag.Enable,
@@ -134,7 +134,7 @@
134134

135135
if (!httpOnly)
136136
{
137-
NetshConfigurator.LogCurrentSslCertBinding(httpsIpPort);
137+
NetshConfigurator.LogCurrentSslCertBinding(httpsIpPort!);
138138
}
139139

140140
Console.WriteLine("Application Info:");

0 commit comments

Comments
 (0)