Replace Illegal{State,Argument} exceptions with more idiomatic kotlin code
This commit is contained in:
parent
56a043669a
commit
d6be966db3
5 changed files with 10 additions and 10 deletions
|
|
@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue