Skip to content
Snippets Groups Projects
Commit adde1e64 authored by srosse's avatar srosse
Browse files

OO-2670: add security if an assignment of the list doesn't exists

parent d1366ea5
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,8 @@ import org.olat.basesecurity.Invitation;
import org.olat.basesecurity.manager.GroupDAO;
import org.olat.core.commons.persistence.DB;
import org.olat.core.id.Identity;
import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;
import org.olat.core.util.StringHelper;
import org.olat.modules.portfolio.Assignment;
import org.olat.modules.portfolio.AssignmentStatus;
......@@ -67,6 +69,8 @@ import org.springframework.stereotype.Service;
*/
@Service
public class BinderDAO {
private static final OLog log = Tracing.createLoggerFor(BinderDAO.class);
@Autowired
private DB dbInstance;
......@@ -248,6 +252,11 @@ public class BinderDAO {
List<Assignment> currentAssignments = new ArrayList<>(currentSection.getAssignments());
for(Assignment currentAssignment:currentAssignments) {
if(currentAssignment == null) {
log.error("Missing assignment: " + currentSection.getKey());
continue;
}
Assignment refAssignment = currentAssignment.getTemplateReference();
if(refAssignment == null) {
if(currentAssignment.getAssignmentStatus() != AssignmentStatus.deleted) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment