Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: 댓글목록 조회시 AttributeConverter 예외 발생 처리 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ open class GenericJsonConverter<T>(private val typeReference: TypeReference<T>)
}
}

override fun convertToEntityAttribute(jsonStr: String): T {
override fun convertToEntityAttribute(jsonStr: String?): T? {
// Json 문자열 -> Object

// TODO (larry.x) writerInfo 가 null 인 경우에 jsonStr not-nullable 이어서
// 실패하는 문제가 있어서 임시로 처리해두었음
if (jsonStr == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거를 Sentry 보고 아차 했는데..ㅎㅎ

writerInfo 필드를 not-null 로 변경했습니다! (기존 데이터도 not-null 로 변경)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이후 예외처리가 not-null 이지만 Null을 고려해야할 것 같아서, 위 코드는 미안하지만 다시 제거해도 괜찮지 않을까 의견 드립니당!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giyeon95 넹넹 요거 그러면 머지 안하고 브랜치 삭제하겠읍니당

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@4whomtbts 넵 좋습니다~~!

return null
}
return try {
objectMapper.readValue(jsonStr, typeReference)
} catch (e: IOException) {
Expand Down