Only run job filter for specific jobs, null exceptio

I have written a job filter which sends an email after a job has failed ten times. Only I am struggling to make this job filter only work for this specific job and not all the others. As I need to inject somethings into (e.g. mail service) I have added it as a global job filter.

I have the following code in my OnStateElection-method only occasionally I am getting a null exception on this line. I am not understanding why this happens:

            if (context.Job.Type.FullName != typeof(DrawdownTask).FullName) {
                 return;
            }

Am I am doing this incorrectly?