Skip to content

Commit

Permalink
Performed null checks on schoolAtGradId and retrieved the mincode fro…
Browse files Browse the repository at this point in the history
…m school clob. (#741)
  • Loading branch information
githubmamatha authored Jan 23, 2025
1 parent 15505f3 commit 802451e
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,10 @@ public StudentDemographic getStudentDemographics(String pen, String accessToken)

String gradDate = null;
String formerStudent = "F";
GraduationStudentRecordEntity graduationStudentRecordEntity = null;
Optional<GraduationStudentRecordEntity> graduationStudentRecordEntityOptional = graduationStatusRepository.findById(UUID.fromString(gradSearchStudent.getStudentID()));
if(graduationStudentRecordEntityOptional.isPresent()) {
GraduationStudentRecordEntity graduationStudentRecordEntity = graduationStudentRecordEntityOptional.get();
graduationStudentRecordEntity = graduationStudentRecordEntityOptional.get();
long sessionInterval = Integer.MAX_VALUE;
GraduationData graduationData = null;
if(StringUtils.isNotBlank(graduationStudentRecordEntity.getStudentGradData())) {
Expand All @@ -441,13 +442,15 @@ public StudentDemographic getStudentDemographics(String pen, String accessToken)
}
}

SchoolClob schoolClob = null;
if (StringUtils.isNotBlank(gradSearchStudent.getSchoolOfRecordId())) {
schoolClob = getSchoolClob(StringUtils.isNotBlank(gradSearchStudent.getSchoolOfRecordId())?
UUID.fromString(gradSearchStudent.getSchoolOfRecordId()) : null, accessToken);
if(graduationStudentRecordEntity == null) {
validation.addErrorAndStop("Student record with student Id %s not found", gradSearchStudent.getStudentID());
}

UUID schoolId = graduationStudentRecordEntity.getSchoolAtGradId() != null && !graduationStudentRecordEntity.getSchoolAtGradId().equals(graduationStudentRecordEntity.getSchoolOfRecordId())?
graduationStudentRecordEntity.getSchoolAtGradId() : graduationStudentRecordEntity.getSchoolOfRecordId();
SchoolClob schoolClob = getSchoolClob(schoolId, accessToken);
if(schoolClob == null) {
validation.addErrorAndStop("School with schoolId %s not found", gradSearchStudent.getSchoolOfRecordId());
validation.addErrorAndStop("School with schoolId %s not found", schoolId);
}

String englishCert = "";
Expand Down

0 comments on commit 802451e

Please sign in to comment.