Skip to content

Commit

Permalink
refactor: (#301) value 필드 nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 committed Jan 23, 2023
1 parent 8b24f24 commit 8374a53
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import org.springframework.validation.BindingResult
**/
class CustomFieldError(
val field: String,
val value: String,
val value: String?,
val reason: String
) {
companion object {
fun of(field: String, value: String, reason: String): List<CustomFieldError> {
fun of(field: String, value: String?, reason: String): List<CustomFieldError> {
val fieldErrors: MutableList<CustomFieldError> = ArrayList()
fieldErrors.add(CustomFieldError(field, value, reason))
return fieldErrors
Expand All @@ -27,7 +27,7 @@ class CustomFieldError(
return fieldErrors.map { error ->
CustomFieldError(
field = error.field,
value = error.rejectedValue.toString(),
value = error.rejectedValue?.toString(),
reason = error.defaultMessage!!
)
}
Expand Down

0 comments on commit 8374a53

Please sign in to comment.