Skip to content

Commit

Permalink
fix(kmp): Fix StringExt on iOS (#3323)
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshiotomakan authored Jul 21, 2023
1 parent 89abacb commit 1c81571
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlinx.cinterop.CValuesRef
import kotlinx.cinterop.toKString

internal fun String?.toTwString(): COpaquePointer? =
TWStringCreateWithUTF8Bytes(this)
this?.let { TWStringCreateWithUTF8Bytes(it) }

internal fun CValuesRef<*>?.fromTwString(): String? =
TWStringUTF8Bytes(this)?.toKString()
this?.let { TWStringUTF8Bytes(it)?.toKString() }

0 comments on commit 1c81571

Please sign in to comment.