Why does this code give me an error?
Variable does not exist: incomingCase global Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, Messaging.InboundEnvelope env){
List<EmailMessage> lstEmailMessage = new List<EmailMessage>();
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
List<String> toAddresses = email.toAddresses;
try{
System.debug('Not able to get Inside');
if(toAddresses.size()>0){
System.debug('Inside the to Addresses.size');
Case incomingCase = new Case();
incomingCase.Description = email.plainTextBody;
incomingCase.Subject = email.subject;
incomingCase.Status= 'New';
incomingCase.RecordTypeId = caseComplaintRecordType;
incomingCase.Origin ='Support Email';
incomingCase.ContactId = email.fromName;
if(email.subject.contains('Nothing')){
}
}
Database.SaveResult[] srList = Database.insert(incomingCase, True);