Skip to content

Commit

Permalink
android [nfc]: Push a try/catch into initializer expression.
Browse files Browse the repository at this point in the history
This Kotlin feature lets us simplify the code slightly and express
the intention more directly: this is the one place we ever set
this variable.
  • Loading branch information
gnprice committed Jul 18, 2020
1 parent c13f889 commit d8be9dc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions android/app/src/main/java/com/zulipmobile/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ open class MainActivity : ReactActivity() {
}

private fun handleSend(intent: Intent) {
val params: WritableMap
try {
params = getParamsFromIntent(intent)
val params: WritableMap = try {
getParamsFromIntent(intent)
} catch (e: ShareParamsParseException) {
Log.w(TAG, "Ignoring malformed share Intent: ${e.message}")
return
Expand Down

0 comments on commit d8be9dc

Please sign in to comment.