Fixed null error in CourseList method generateList