트리거가 실행되면 "execution of [EventName] caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.[TriggerName]: line [XX], column [XX]" 오류 메시지가 생성되는 경우가 있습니다.
이 오류는 인스턴스화되지 않은 개체를 사용하려고 하는 코드 한 줄이나 초기화되지 않은 개체 속성 때문에 발생합니다.
참고: 사이트 필드를 비워 둔 경우에도 이 오류 메시지가 생성됩니다.
사용할 개체 및/또는 속성이 null이 아닌지 확인하여 해결합니다. 이 예에서는 코드를 다음과 같이 수정해야 합니다.
Account newAccount = accountMap.get(oldAccount.Name);
if (newAccount != null)
if (newAccount.Site != null)
i = newAccount.Site.length();
Account newAccount = accountMap.get(oldAccount.Name);
try {
i = newAccount.Site.length();
}
catch (System.NullPointerException e) {
e1 = e; // can be assigned to a variable to display a user-friendly error message
}
예외 처리에 대한 자세한 내용은 "예외 메서드 사용" 또는 "예외 변수 사용"에서 Apex 언어 참조를 확인하십시오.
변수 초기화에 대한 자세한 내용은 2장 "언어 구문"의 "변수" 및 "대소문자 구분" 항목을 참조하십시오.
000385601

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.