handle course_id being None
(possible in case of an error where course_id was not captured)