single group fix

This commit is contained in:
Filip Izydorczyk 2021-01-25 16:23:28 +01:00
parent bb7f1b6737
commit 72f049b478

View File

@ -108,8 +108,12 @@ public class AssignmentResponse {
this.id = course.getId();
this.name = course.getName();
this.symbol = course.getSymbol();
this.classes = new GroupWithCapacityResponse(classes, ammounts.get(classes.getGroup().getId()));
this.lecture = new GroupWithCapacityResponse(lecture, ammounts.get(lecture.getGroup().getId()));
this.classes = classes != null
? new GroupWithCapacityResponse(classes, ammounts.get(classes.getGroup().getId()))
: null;
this.lecture = lecture != null
? new GroupWithCapacityResponse(lecture, ammounts.get(lecture.getGroup().getId()))
: null;
}
/**
@ -121,8 +125,8 @@ public class AssignmentResponse {
this.id = course.getId();
this.name = course.getName();
this.symbol = course.getSymbol();
this.classes = new GroupWithCapacityResponse(classes);
this.lecture = new GroupWithCapacityResponse(lecture);
this.classes = classes != null ? new GroupWithCapacityResponse(classes) : null;
this.lecture = lecture != null ? new GroupWithCapacityResponse(lecture) : null;
}
/**