Skip to content

Commit da3d6d8

Browse files
committed
Do not initialize _configuration when only a section is provided
1 parent 0bc3c2c commit da3d6d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Serilog.Settings.Configuration/Settings/Configuration/ConfigurationReader.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Reflection;
@@ -37,8 +37,7 @@ public ConfigurationReader(IConfiguration configuration, DependencyContext depen
3737
// IConfiguration parameters in the target methods will not be populated.
3838
public ConfigurationReader(IConfigurationSection configSection, DependencyContext dependencyContext)
3939
{
40-
_configuration = configSection ?? throw new ArgumentNullException(nameof(configSection));
41-
_section = configSection;
40+
_section = configSection ?? throw new ArgumentNullException(nameof(configSection));
4241
_dependencyContext = dependencyContext;
4342
_configurationAssemblies = LoadConfigurationAssemblies();
4443
}

0 commit comments

Comments
 (0)