Replace Illegal{State,Argument} exceptions with more idiomatic kotlin code

This commit is contained in:
Yevhen Babiichuk (DustDFG) 2026-01-09 19:39:47 +02:00 committed by Aayush Gupta
parent 56a043669a
commit d6be966db3
5 changed files with 10 additions and 10 deletions

View file

@ -92,7 +92,7 @@ class AboutActivity : AppCompatActivity() {
return when (position) {
posAbout -> AboutFragment()
posLicense -> LicenseFragment.newInstance(SOFTWARE_COMPONENTS)
else -> throw IllegalArgumentException("Unknown position for ViewPager2")
else -> error("Unknown position for ViewPager2")
}
}
@ -105,7 +105,7 @@ class AboutActivity : AppCompatActivity() {
return when (position) {
posAbout -> R.string.tab_about
posLicense -> R.string.tab_licenses
else -> throw IllegalArgumentException("Unknown position for ViewPager2")
else -> error("Unknown position for ViewPager2")
}
}
}