Skip to content

Commit

Permalink
Support TargetDefaultWrapper and TargetDefaultParameters (code review)
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot committed Apr 28, 2021
1 parent 6ff3e6c commit dd29028
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,13 +316,13 @@ private IConfigurationSection GetTargetDefaultParametersSection()
if (_topElement)
{
var targetDefaultParameters = _configurationSection.GetSection(TargetDefaultParameters);
if (targetDefaultParameters != null && targetDefaultParameters.GetChildren().Any())
if (targetDefaultParameters?.GetChildren().Any() == true)
{
return targetDefaultParameters;
}

targetDefaultParameters = _configurationSection.GetSection(DefaultTargetParameters);
if (targetDefaultParameters != null && targetDefaultParameters.GetChildren().Any())
if (targetDefaultParameters?.GetChildren().Any() == true)
{
return targetDefaultParameters;
}
Expand All @@ -336,13 +336,13 @@ private IConfigurationSection GetTargetDefaultWrapperSection()
if (_topElement)
{
var targetDefaultWrapper = _configurationSection.GetSection(TargetDefaultWrapper);
if (targetDefaultWrapper != null && targetDefaultWrapper.GetChildren().Any())
if (targetDefaultWrapper?.GetChildren().Any() == true)
{
return targetDefaultWrapper;
}

targetDefaultWrapper = _configurationSection.GetSection(DefaultWrapper);
if (targetDefaultWrapper != null && targetDefaultWrapper.GetChildren().Any())
if (targetDefaultWrapper?.GetChildren().Any() == true)
{
return targetDefaultWrapper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static ISetupBuilder LoadConfigurationFromSection(this ISetupBuilder setu
if (!string.IsNullOrEmpty(configSection))
{
var nlogConfig = configuration.GetSection(configSection);
if (nlogConfig != null && nlogConfig.GetChildren().Any())
if (nlogConfig?.GetChildren().Any() == true)
{
setupBuilder.LogFactory.Configuration = new NLogLoggingConfiguration(nlogConfig, setupBuilder.LogFactory);
}
Expand Down

0 comments on commit dd29028

Please sign in to comment.