function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ankitsrivastav7771.3911494159052937E12ankitsrivastav7771.3911494159052937E12 

while Writing Test class error, System.NullPointerException: Attempt to de-reference a null object. Can any one help me out what kind of error it is?

@isTest(SeeAllData=true)
public class TestupdateFallout
{
static testMethod  void updateFallout()
{
  Messaging.InboundEmail email = new Messaging.InboundEmail() ;
  Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
  // setup the data for the email

  email.fromAddress = 'rajat@salesforce.com';

  env.toAddress=('test_email_service@v-owqjewyhqhs8stb49ok48inl50drvv20gd0siiwzsbiu38uix.11-4ypueay.cs18.apex.salesforce.com');
 
  email.htmlBody='<?xml version="1.0" encoding="UTF-8"?><ValidateConfigResult><Configuration><ConfigId>CE05502807</ConfigId><Status>false</Status></Configuration></ValidateConfigResult>';
  
  test.startTest();
   
  updateFallout testInbound=new updateFallout();
 
   testInbound.handleInboundEmail(email,env);
      
     test.stopTest();
         

}   
}
Phillip SouthernPhillip Southern
When you get the error, in your stack trace it should give you a line number where the error occured...what is the line number and the corresponding code?
ankitsrivastav7771.3911494159052937E12ankitsrivastav7771.3911494159052937E12
Class.TestupdateFallout.updateFallout: line 24, column 1
ankitsrivastav7771.3911494159052937E12ankitsrivastav7771.3911494159052937E12
error on line 24
testInbound.handleInboundEmail(email,envelope);
Phillip SouthernPhillip Southern
Is method handleInboundEmail properly defined somewhere?