Source:
<code>public ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); boolean isHtmlTableNeeded = getRequestParamAsBoolean(Const.ParamsNames.CSV_TO_HTML_TABLE_NEEDED); Assumption.assertNotNull(courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible(instructor, logic.getCourse(courseId)); InstructorCourseDetailsPageData data = new InstructorCourseDetailsPageData(account); if (isHtmlTableNeeded) { String courseStudentListAsCsv = logic.getCourseStudentListAsCsv(courseId, account.googleId); data.setStudentListHtmlTableAsString(StringHelper.csvToHtmlTable(courseStudentListAsCsv)); statusToAdmin = "instructorCourseDetails Page Ajax Html table Load<br>" + "Viewing Student List Table for Course <span class=\"bold\">[" + courseId + "]</span>"; return createAjaxResult(data); } CourseDetailsBundle courseDetails = logic.getCourseDetails(courseId); List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); <START> List<StudentAttributes> students = logic.getStudentsForCourse(courseId); <END> StudentAttributes.sortByNameAndThenByEmail(students); data.init(instructor, courseDetails, instructors); if (students.isEmpty()) { String message = String.format(Const.StatusMessages.INSTRUCTOR_COURSE_EMPTY, data.getInstructorCourseEnrollLink(courseId)); statusToUser.add(new StatusMessage(message, StatusMessageColor.WARNING)); } statusToAdmin = "instructorCourseDetails Page Load<br>" + "Viewing Course Details for Course <span class=\"bold\">[" + courseId + "]</span>"; return createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_DETAILS, data); }</code><technical_language>If wrong, I omit this too. check if students (line 54) courseDetails (line 47)</technical_language>

Target:
public ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); boolean isHtmlTableNeeded = getRequestParamAsBoolean(Const.ParamsNames.CSV_TO_HTML_TABLE_NEEDED); Assumption.assertNotNull(courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, account.googleId); new GateKeeper().verifyAccessible(instructor, logic.getCourse(courseId)); InstructorCourseDetailsPageData data = new InstructorCourseDetailsPageData(account); if (isHtmlTableNeeded) { String courseStudentListAsCsv = logic.getCourseStudentListAsCsv(courseId, account.googleId); data.setStudentListHtmlTableAsString(StringHelper.csvToHtmlTable(courseStudentListAsCsv)); statusToAdmin = "instructorCourseDetails Page Ajax Html table Load<br>" + "Viewing Student List Table for Course <span class=\"bold\">[" + courseId + "]</span>"; return createAjaxResult(data); } CourseDetailsBundle courseDetails = logic.getCourseDetails(courseId); List<InstructorAttributes> instructors = logic.getInstructorsForCourse(courseId); data.init(instructor, courseDetails, instructors); if (courseDetails.getStats().getStudentsTotal() == 0) { String message = String.format(Const.StatusMessages.INSTRUCTOR_COURSE_EMPTY, data.getInstructorCourseEnrollLink(courseId)); statusToUser.add(new StatusMessage(message, StatusMessageColor.WARNING)); } statusToAdmin = "instructorCourseDetails Page Load<br>" + "Viewing Course Details for Course <span class=\"bold\">[" + courseId + "]</span>"; return createShowPageResult(Const.ViewURIs.INSTRUCTOR_COURSE_DETAILS, data); }