Skip to content

Commit 871482b

Browse files
authored
Merge pull request #413 from GSM-MSG/hotfix/412-empty-authentication-form-500
🔁 인증제 폼을 찾을 수 없는 경우, 빈 배열을 반환
2 parents b602a6b + a4e0980 commit 871482b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

sms-core/src/main/kotlin/team/msg/sms/domain/authentication/usecase/QueryAuthenticationFormUseCase.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import team.msg.sms.domain.authentication.service.*
1111
import team.msg.sms.domain.file.dto.res.FileResponseData
1212
import team.msg.sms.domain.file.service.FileService
1313
import java.util.*
14-
import kotlin.math.max
1514

1615
@UseCase
1716
class QueryAuthenticationFormUseCase(
@@ -25,7 +24,15 @@ class QueryAuthenticationFormUseCase(
2524
) {
2625
@Transactional(readOnly = true)
2726
fun execute(): QueryAuthenticationFormResponseData {
28-
val authenticationFormId = authenticationFormService.getActiveAuthenticationFormId()
27+
val authenticationFormId = runCatching {
28+
authenticationFormService.getActiveAuthenticationFormId()
29+
}.getOrNull()
30+
31+
authenticationFormId ?: return QueryAuthenticationFormResponseData(
32+
files = emptyList(),
33+
content = emptyList()
34+
)
35+
2936
val files = fetchFiles(authenticationFormId)
3037
val groups = fetchAuthenticationGroups(authenticationFormId)
3138
val authenticationSections = fetchAuthenticationSections(groups)

0 commit comments

Comments
 (0)