File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/kotlin/dsm/pick2024/domain/attendance/domain/service Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments