Added null check to prevent error when no jobs are returned.