Added null check suggested by Kohsuke