Skip to content

Commit 5a571bf

Browse files
authored
AspNetExtensions - Refactor to improve nullable logic (#1104)
1 parent 1411a9f commit 5a571bf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/NLog.Web.AspNetCore/AspNetExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ private static NLogLoggerProvider CreateNLogLoggerProvider(IServiceProvider serv
396396

397397
if (configuration is null || !TryLoadConfigurationFromSection(provider, configuration))
398398
{
399-
string? nlogConfigFile = null;
399+
string nlogConfigFile = string.Empty;
400400
var contentRootPath = hostEnvironment?.ContentRootPath;
401401
var environmentName = hostEnvironment?.EnvironmentName;
402402
if (!string.IsNullOrWhiteSpace(contentRootPath) || !string.IsNullOrWhiteSpace(environmentName))
@@ -427,7 +427,7 @@ private static NLogLoggerProvider CreateNLogLoggerProvider(IServiceProvider serv
427427
return provider;
428428
}
429429

430-
private static string? ResolveEnvironmentNLogConfigFile(string? basePath, string? environmentName)
430+
private static string ResolveEnvironmentNLogConfigFile(string? basePath, string? environmentName)
431431
{
432432
if (!string.IsNullOrWhiteSpace(basePath))
433433
{
@@ -452,7 +452,7 @@ private static NLogLoggerProvider CreateNLogLoggerProvider(IServiceProvider serv
452452
if (!string.IsNullOrWhiteSpace(environmentName))
453453
return $"nlog.{environmentName}.config";
454454

455-
return null;
455+
return string.Empty;
456456
}
457457

458458
private static bool IsLoggingConfigurationLoaded(LoggingConfiguration cfg)

0 commit comments

Comments
 (0)