From b63a5f0d444b3732deb37bd6e61a11a2ecbb6df3 Mon Sep 17 00:00:00 2001 From: anhefti Date: Tue, 3 May 2022 10:39:07 +0200 Subject: [PATCH] error handling exam template -> just take first default if there are more then one --- .../webservice/servicelayer/dao/impl/ExamTemplateDAOImpl.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamTemplateDAOImpl.java b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamTemplateDAOImpl.java index 554db721..a4fae45a 100644 --- a/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamTemplateDAOImpl.java +++ b/src/main/java/ch/ethz/seb/sebserver/webservice/servicelayer/dao/impl/ExamTemplateDAOImpl.java @@ -110,10 +110,6 @@ public class ExamTemplateDAOImpl implements ExamTemplateDAO { throw new ResourceNotFoundException(EntityType.EXAM_TEMPLATE, String.valueOf(institutionId)); } - if (defaults.size() != 1) { - throw new IllegalStateException("Expected one default but was: " + defaults.size()); - } - return defaults.get(0); }) .flatMap(this::toDomainModel);