added check for null ticket in email observer