Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Bindicate/Bindicate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageTags>di, ioc, service, collection, extensions, attribute</PackageTags>
<PackageReleaseNotes>Add support for Decorators</PackageReleaseNotes>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<Version>1.7.0</Version>
<Version>1.7.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions src/Bindicate/Configuration/AutowiringBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@
{
var configSection = configuration.GetSection(attr.ConfigurationSection);

if (!configSection.Exists())
throw new InvalidOperationException($"Missing configuration section: {attr.ConfigurationSection}");

var genericOptionsConfigureMethod = typeof(OptionsConfigurationServiceCollectionExtensions)
.GetMethods()
.FirstOrDefault(m => m.Name == "Configure" && m.GetParameters().Length == 2);
if (configSection.Exists())
{
var genericOptionsConfigureMethod = typeof(OptionsConfigurationServiceCollectionExtensions)
.GetMethods()
.FirstOrDefault(m => m.Name == "Configure" && m.GetParameters().Length == 2);

var specializedMethod = genericOptionsConfigureMethod.MakeGenericMethod(type);
specializedMethod.Invoke(null, new object[] { _services, configSection });
var specializedMethod = genericOptionsConfigureMethod.MakeGenericMethod(type);

Check warning on line 145 in src/Bindicate/Configuration/AutowiringBuilder.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Dereference of a possibly null reference.

Check warning on line 145 in src/Bindicate/Configuration/AutowiringBuilder.cs

View workflow job for this annotation

GitHub Actions / run_test

Dereference of a possibly null reference.
specializedMethod.Invoke(null, new object[] { _services, configSection });
}
}
}
}
Expand Down Expand Up @@ -324,7 +324,7 @@
}
}).ToArray();

return Activator.CreateInstance(decoratorType, args);

Check warning on line 327 in src/Bindicate/Configuration/AutowiringBuilder.cs

View workflow job for this annotation

GitHub Actions / create_nuget

Possible null reference return.

Check warning on line 327 in src/Bindicate/Configuration/AutowiringBuilder.cs

View workflow job for this annotation

GitHub Actions / run_test

Possible null reference return.
},
previousDescriptor.Lifetime
);
Expand Down
Loading