diff --git a/sources/NetArchTest/Dependencies/TypeCheckingContext.cs b/sources/NetArchTest/Dependencies/TypeCheckingContext.cs index e3e4798..1afa979 100644 --- a/sources/NetArchTest/Dependencies/TypeCheckingContext.cs +++ b/sources/NetArchTest/Dependencies/TypeCheckingContext.cs @@ -105,7 +105,7 @@ private void CheckFields(TypeDefinition typeToCheck) { CheckCustomAttributes(field); CheckTypeReference(field.FieldType); - if (_serachForDependencyInFieldConstant && field.HasConstant && field.FieldType.FullName == typeof(string).FullName) + if (_serachForDependencyInFieldConstant && field.HasConstant && field.FieldType.FullName == typeof(string).FullName && field.Constant != null) { _result.CheckType(field.Constant.ToString()); }