Skip to content

Commit

Permalink
Merge pull request #67 from Peach2Peach/bugfix/prevent-crash-addressA…
Browse files Browse the repository at this point in the history
…sString

Bugfix/prevent crash address as string
  • Loading branch information
BitcoinZavior authored Nov 21, 2023
2 parents ee2fa74 + a742605 commit 0bf5992
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion android/src/main/java/io/ltbl/bdkrn/BdkRnModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,11 @@ class BdkRnModule(reactContext: ReactApplicationContext) :

@ReactMethod
fun addressAsString(id: String, result: Promise) {
result.resolve(_addresses[id]!!.asString())
try {
result.resolve(_addresses[id]!!.asString())
} catch (error: Throwable) {
result.reject("Couldn't parse address string", error.localizedMessage, error)
}
}

/** Address methods ends*/
Expand Down

0 comments on commit 0bf5992

Please sign in to comment.