3381 Fix NPE when supervisors fill in individual criteria before final thesis is uploaded
This commit is contained in:
parent
8ccd6156b7
commit
a6d2502ebb
@ -264,11 +264,20 @@ public class SendToExaminer extends GenericPanel<Project> {
|
||||
.map(instant -> instant.atZone(ZoneId.systemDefault()))
|
||||
.map(ZonedDateTime::toLocalDate);
|
||||
|
||||
if (seminarDate.isPresent() && seminarDate.get().isAfter(finalThesis.getUploadDate())) {
|
||||
return seminarDate.get();
|
||||
}
|
||||
else {
|
||||
boolean hasFinalThesis = finalThesis != null;
|
||||
boolean hasSeminarDate = seminarDate.isPresent();
|
||||
if (hasFinalThesis && hasSeminarDate) {
|
||||
if (finalThesis.getUploadDate().isAfter(seminarDate.get())) {
|
||||
return finalThesis.getUploadDate();
|
||||
} else {
|
||||
return seminarDate.get();
|
||||
}
|
||||
} else if (hasFinalThesis) {
|
||||
return finalThesis.getUploadDate();
|
||||
} else if (hasSeminarDate) {
|
||||
return seminarDate.get();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user