Skip to content

Commit

Permalink
code
Browse files Browse the repository at this point in the history
  • Loading branch information
BBesrour committed Sep 10, 2024
1 parent b1c6b71 commit c40a64b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,12 @@ public void processResult() {

SecurityUtils.setAuthorizationObject();
Optional<Participation> participationOptional = participationRepository.findWithProgrammingExerciseWithBuildConfigById(buildJob.participationId());
ProgrammingExerciseParticipation participation = null;

if (buildResult != null) {
Result result = null;
try {
if (participationOptional.isPresent()) {
participation = (ProgrammingExerciseParticipation) participationOptional.get();
ProgrammingExerciseParticipation participation = (ProgrammingExerciseParticipation) participationOptional.get();

// In case the participation does not contain the exercise, we have to load it from the database
if (participation.getProgrammingExercise() == null) {
Expand Down Expand Up @@ -159,8 +158,9 @@ public void processResult() {
}

if (participationOptional.isPresent()) {
if (participation == null) {
participation = (ProgrammingExerciseParticipation) participationOptional.get();
ProgrammingExerciseParticipation participation = (ProgrammingExerciseParticipation) participationOptional.get();
if (participation.getExercise() == null) {
participation.setExercise(programmingExerciseRepository.getProgrammingExerciseFromParticipation(participation));
}

if (result != null) {
Expand Down

0 comments on commit c40a64b

Please sign in to comment.