From a4e0980a848a1303d7ab6bd446549699d392a97f Mon Sep 17 00:00:00 2001 From: enbraining Date: Tue, 24 Sep 2024 17:08:49 +0900 Subject: [PATCH] =?UTF-8?q?:recycle:=20=EC=9D=B8=EC=A6=9D=EC=A0=9C=20?= =?UTF-8?q?=ED=8F=BC=EC=9D=84=20=EC=B0=BE=EC=9D=84=20=EC=88=98=20=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EA=B2=BD=EC=9A=B0,=20=EB=B9=88=20=EB=B0=B0?= =?UTF-8?q?=EC=97=B4=EC=9D=84=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usecase/QueryAuthenticationFormUseCase.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sms-core/src/main/kotlin/team/msg/sms/domain/authentication/usecase/QueryAuthenticationFormUseCase.kt b/sms-core/src/main/kotlin/team/msg/sms/domain/authentication/usecase/QueryAuthenticationFormUseCase.kt index 90d09d33..a33ca5ef 100644 --- a/sms-core/src/main/kotlin/team/msg/sms/domain/authentication/usecase/QueryAuthenticationFormUseCase.kt +++ b/sms-core/src/main/kotlin/team/msg/sms/domain/authentication/usecase/QueryAuthenticationFormUseCase.kt @@ -11,7 +11,6 @@ import team.msg.sms.domain.authentication.service.* import team.msg.sms.domain.file.dto.res.FileResponseData import team.msg.sms.domain.file.service.FileService import java.util.* -import kotlin.math.max @UseCase class QueryAuthenticationFormUseCase( @@ -25,7 +24,15 @@ class QueryAuthenticationFormUseCase( ) { @Transactional(readOnly = true) fun execute(): QueryAuthenticationFormResponseData { - val authenticationFormId = authenticationFormService.getActiveAuthenticationFormId() + val authenticationFormId = runCatching { + authenticationFormService.getActiveAuthenticationFormId() + }.getOrNull() + + authenticationFormId ?: return QueryAuthenticationFormResponseData( + files = emptyList(), + content = emptyList() + ) + val files = fetchFiles(authenticationFormId) val groups = fetchAuthenticationGroups(authenticationFormId) val authenticationSections = fetchAuthenticationSections(groups)