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
IMU AdminIMU Admin 

Error occurred trying to load the template for preview: Attempt to de-reference a null object. Please try editing your markup to correct the problem.

Hi,

I am trying to add a Visual Force component into a VisualForce email template but keep getting the error message below:

[Error]
Error occurred trying to load the template for preview: Attempt to de-reference a null object. Please try editing your markup to correct the problem.

I do not get any errors when saving class or component. 

Apex Class:

public class InteractionsForCustomer {
    
    
private List<Interactions__c> allInteractions;
        private Interactions__c currentInteractions;
 
    public InteractionsForCustomer() {
         
     }
 
    public List<Interactions__c> getAllInteractions() {
                allInteractions = [Select Id, Name from Interactions__c where Stage__c = 'Open' AND Cutomer__c = :currentInteractions.Customer__c];
        return allInteractions;
    }
 
     public Interactions__c getcurrentInteractions() {       
             return currentInteractions;
     }
     public void setcurrentInteractions(Interactions__c val) {
            this.currentInteractions = val;     
      }
}

VisualForce Component

<apex:component controller="InteractionsForCustomer" access="global">
    <apex:dataTable value="{!allInteractions}" var="inv">
        <apex:column >
            <apex:facet name="header">Invoice Name</apex:facet>
            {!inv.Customer__c}
        </apex:column>
    </apex:dataTable>
</apex:component>

Can anybody help??

Thanks
Josh