We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d8e77bd + 8431c50 commit bdb8eecCopy full SHA for bdb8eec
src/AutoMapper/Configuration/MapperConfigurationExpression.cs
@@ -94,7 +94,9 @@ private void AddMapsCore(IEnumerable<Assembly> assembliesToScan)
94
{
95
AddProfile(type.AsType());
96
}
97
- foreach (var autoMapAttribute in type.GetCustomAttributes<AutoMapAttribute>())
+
98
+ var autoMapAttribute = type.GetCustomAttribute<AutoMapAttribute>();
99
+ if (autoMapAttribute != null)
100
101
var mappingExpression = autoMapAttributeProfile.CreateMap(autoMapAttribute.SourceType, type);
102
autoMapAttribute.ApplyConfiguration(mappingExpression);
0 commit comments