Skip to content

Commit

Permalink
Use _ for unused caught exceptions
Browse files Browse the repository at this point in the history
An Android Studio lint was complaining about this.
  • Loading branch information
robinlinden committed Nov 28, 2024
1 parent 2f8724b commit 4ff19c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion atox/src/main/kotlin/ui/addcontact/AddContactFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class AddContactFragment : BaseFragment<FragmentAddContactBinding>(FragmentAddCo
putExtra("BEEP_ENABLED", false)
},
)
} catch (e: ActivityNotFoundException) {
} catch (_: ActivityNotFoundException) {
val uri = Uri.parse("https://f-droid.org/en/packages/com.google.zxing.client.android/")
startActivity(Intent(Intent.ACTION_VIEW, uri))
}
Expand Down
4 changes: 2 additions & 2 deletions atox/src/main/kotlin/ui/settings/SettingsFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding>(FragmentSettingsB
val str = it?.toString() ?: ""
val seconds = try {
str.toLong()
} catch (e: NumberFormatException) {
} catch (_: NumberFormatException) {
settingAutoAwaySeconds.error = getString(R.string.bad_positive_number)
return@doAfterTextChanged
}
Expand Down Expand Up @@ -188,7 +188,7 @@ class SettingsFragment : BaseFragment<FragmentSettingsBinding>(FragmentSettingsB
val str = it?.toString() ?: ""
val port = try {
Integer.parseInt(str)
} catch (e: NumberFormatException) {
} catch (_: NumberFormatException) {
proxyPort.error = getString(R.string.bad_port)
return@doAfterTextChanged
}
Expand Down

0 comments on commit 4ff19c7

Please sign in to comment.