Skip to content

Commit

Permalink
fix null pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Krusche committed Oct 20, 2019
1 parent c1d71a2 commit 306e7bd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1075,10 +1075,10 @@ public java.io.File exportStudentRepositories(Long exerciseId, List<ProgrammingE
repo = gitService.getOrCheckoutRepository(participation, repoDownloadClonePath);
gitService.resetToOriginMaster(repo); // start with clean state

if (repositoryExportOptions.isFilterLateSubmissions()) {
if (repositoryExportOptions.isFilterLateSubmissions() && repositoryExportOptions.getFilterLateSubmissionsDate() != null) {
log.debug("Filter late submissions for participation {}", participation.toString());
Optional<Submission> lastValidSubmission = participation.getSubmissions().stream()
.filter(s -> s.getSubmissionDate().isBefore(repositoryExportOptions.getFilterLateSubmissionsDate()))
.filter(s -> s.getSubmissionDate() != null && s.getSubmissionDate().isBefore(repositoryExportOptions.getFilterLateSubmissionsDate()))
.max(Comparator.comparing(Submission::getSubmissionDate));

gitService.filterLateSubmissions(repo, lastValidSubmission, repositoryExportOptions.getFilterLateSubmissionsDate());
Expand Down

0 comments on commit 306e7bd

Please sign in to comment.