Skip to content

Commit 1cfd94e

Browse files
Small fix
1 parent 81cc21b commit 1cfd94e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

api/src/main/java/ca/bc/gov/educ/api/pen/replication/service/GradStudentAdoptService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ public void processEvent(final GraduationStudentRecord student, final Event even
3939
var gradProgramCode = StringUtils.isNotBlank(student.getProgram()) ? student.getProgram().substring(0, 4) : null;
4040
var studentAddress = restUtils.getStudentScholarshipAddressByStudentID(UUID.randomUUID(), student.getStudentID().toString());
4141

42-
String mincodeGrad;
42+
String mincodeGrad = null;
4343
String gradDate;
4444
if(gradProgramCode != null && gradProgramCode.equalsIgnoreCase("SCCP")){
4545
mincodeGrad = null;
4646
gradDate = null;
4747
}else{
48-
mincodeGrad = restUtils.getSchoolBySchoolID(student.getSchoolAtGradId().toString()).get().getMincode() ;
48+
if(student.getSchoolAtGradId() != null){
49+
mincodeGrad = restUtils.getSchoolBySchoolID(student.getSchoolAtGradId().toString()).get().getMincode() ;
50+
}
4951
gradDate = StringUtils.isNotBlank(student.getProgramCompletionDate()) ? student.getProgramCompletionDate().substring(0,7).replace("-","") : null ;
5052
}
5153

0 commit comments

Comments
 (0)