Removed unnecessary check for null

This commit is contained in:
2024-04-07 17:03:33 +02:00
parent e78e5b205f
commit 61f0dab8df

View File

@@ -39,17 +39,17 @@ internal static class Program
OpenApiInfo openApiInfo = new()
{
Version = appSettings?.Settings?.Version,
Title = appSettings?.Settings?.Name,
Description = appSettings?.Settings?.Description
Version = appSettings.Settings?.Version,
Title = appSettings.Settings?.Name,
Description = appSettings.Settings?.Description
};
if (!String.IsNullOrEmpty(appSettings?.OpenApiSettings?.TermsOfServiceUrl))
if (!String.IsNullOrEmpty(appSettings.OpenApiSettings?.TermsOfServiceUrl))
{
openApiInfo.TermsOfService = new Uri(appSettings.OpenApiSettings.TermsOfServiceUrl);
}
if (!String.IsNullOrEmpty(appSettings?.OpenApiSettings?.OpenApiContact?.Name) && !String.IsNullOrEmpty(appSettings?.OpenApiSettings?.OpenApiContact?.Url))
if (!String.IsNullOrEmpty(appSettings.OpenApiSettings?.OpenApiContact?.Name) && !String.IsNullOrEmpty(appSettings.OpenApiSettings?.OpenApiContact?.Url))
{
openApiInfo.Contact = new OpenApiContact
{
@@ -58,7 +58,7 @@ internal static class Program
};
}
if (!String.IsNullOrEmpty(appSettings?.OpenApiSettings?.OpenApiLicense?.Name) && !String.IsNullOrEmpty(appSettings?.OpenApiSettings?.OpenApiLicense?.Url))
if (!String.IsNullOrEmpty(appSettings.OpenApiSettings?.OpenApiLicense?.Name) && !String.IsNullOrEmpty(appSettings.OpenApiSettings?.OpenApiLicense?.Url))
{
openApiInfo.License = new OpenApiLicense
{