Skip to content

Commit

Permalink
Merge pull request #97 from ColaGom/refact-ios-null-safety
Browse files Browse the repository at this point in the history
Refact DebugAntilog null-safety for ios
  • Loading branch information
AAkira authored Apr 6, 2022
2 parents 6e40914 + bfa5a8d commit 910917c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion napier/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ kotlin {
val macosArm64Main by getting {
dependsOn(darwinMain)
}
val macosArm64Text by getting {
val macosArm64Test by getting {
dependsOn(darwinTest)
}
val iosSimulatorArm64Main by getting {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,12 @@ actual class DebugAntilog(

// find stack trace
private fun performTag(tag: String): String {
val thread = NSThread.callStackSymbols
val symbols = NSThread.callStackSymbols
if (symbols.size <= CALL_STACK_INDEX) return tag

return if (thread.size >= CALL_STACK_INDEX) {
createStackElementTag(thread[CALL_STACK_INDEX] as String)
} else {
tag
}
return (symbols[CALL_STACK_INDEX] as? String)?.let {
createStackElementTag(it)
} ?: tag
}

internal fun createStackElementTag(string: String): String {
Expand Down

0 comments on commit 910917c

Please sign in to comment.