1
에서 역 참조됩니다 지금은 방법을 아래에있는 Null 참조 '#as (테스트, 0)'라인 I 클래스 이하가 28
public class Test1
{
public Test2 Test2 { get; set; }
}
public class Test2 { }
,
private void Test()
{
var test = ConfigurationManager.GetSection("Test");
if (test != null)
{
var a= (test as Test1).Test2;
}
}
지금은 Klockwork 오류 말을 얻고,
Null reference '#as(test, 0)' that comes from line 28 will be dereferenced at line 28
참고 이것은 Klockwork 오류이지만 C# 컴파일은 오류가 발생하지 않습니다. 코드의 라인 아래에서
오류,
var a= (test as Test1).Test2;