diff --git a/restservice/src/main/java/com/plannaplan/controllers/ExchangeController.java b/restservice/src/main/java/com/plannaplan/controllers/ExchangeController.java index ee12862..e2aa8b7 100755 --- a/restservice/src/main/java/com/plannaplan/controllers/ExchangeController.java +++ b/restservice/src/main/java/com/plannaplan/controllers/ExchangeController.java @@ -88,7 +88,8 @@ public class ExchangeController extends TokenBasedController { final Assignment assignmentInstance = assignment.get(); final Groups groupInstance = group.get(); - if (assignmentInstance.getGroup().getCourseId().getId() != groupInstance.getCourseId().getId()) { + if (assignmentInstance.getGroup().getCourseId() != null + && assignmentInstance.getGroup().getCourseId().getId() != groupInstance.getCourseId().getId()) { return new ResponseEntity<>("You can performe exchange only within one course.", HttpStatus.BAD_REQUEST); }