Skip to content

Commit

Permalink
♻️ Update NotBlankString.Companion.createOrNull(Any?) (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
LVMVRQUXL committed Feb 21, 2024
1 parent e4b0d05 commit c240bb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commonMain/kotlin/kotools/types/text/NotBlankString.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public value class NotBlankString private constructor(
@JvmSynthetic
public fun createOrNull(value: Any?): NotBlankString? {
val text: String = value.toString()
return if (text.isNotBlank()) NotBlankString(text)
val isValid: Boolean = text.isNotBlank()
return if (isValid) NotBlankString(text)
else null
}

Expand Down

0 comments on commit c240bb8

Please sign in to comment.