Skip to content

Commit abf2875

Browse files
committed
feat :: earlyreturn 10교시 초과 신청 및 교시 변환 중 사고 에러 처리
1 parent ca8abf6 commit abf2875

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/dsm/pick2024/domain/attendance/domain/service/AttendanceService.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class AttendanceService {
5454
}
5555
}
5656
ApplicationType.PERIOD -> {
57-
val startPeriod = start.replace("교시", "").toInt()
58-
val endPeriod = end.replace("교시", "").toInt()
57+
val startPeriod = start.replace("교시", "").toIntOrNull() ?: throw InvalidPeriodException
58+
val endPeriod = end.replace("교시", "").toIntOrNull() ?: throw InvalidPeriodException
5959
if (startPeriod > endPeriod || startPeriod < 1 || endPeriod > 10) {
6060
throw InvalidPeriodException
6161
}
@@ -73,7 +73,7 @@ class AttendanceService {
7373
}
7474
ApplicationType.PERIOD -> {
7575
val startPeriod = start.replace("교시", "").toInt()
76-
if (startPeriod < 1) {
76+
if (startPeriod < 1 || startPeriod > 10) {
7777
throw InvalidPeriodException
7878
}
7979
}

0 commit comments

Comments
 (0)