generated from pricelees/issue-pr-template
fix: Jpa AuditorAware에서의 NPE 수정
This commit is contained in:
parent
6e99917a34
commit
1972a5ca63
@ -18,8 +18,12 @@ class JpaConfig {
|
|||||||
|
|
||||||
class MdcAuditorAware : AuditorAware<Long> {
|
class MdcAuditorAware : AuditorAware<Long> {
|
||||||
override fun getCurrentAuditor(): Optional<Long> {
|
override fun getCurrentAuditor(): Optional<Long> {
|
||||||
val memberIdStr = MDC.get(MDC_MEMBER_ID_KEY)
|
val memberIdStr: String? = MDC.get(MDC_MEMBER_ID_KEY)
|
||||||
|
|
||||||
return Optional.ofNullable(memberIdStr.toLongOrNull())
|
if (memberIdStr == null) {
|
||||||
|
return Optional.empty()
|
||||||
|
} else {
|
||||||
|
return Optional.of(memberIdStr.toLong())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user