prevent ArrayIndexOutOfBoundsException

This commit is contained in:
Milos Kozak 2020-07-09 18:52:09 +02:00
parent 45f168d427
commit c2e5470da7

View file

@ -146,7 +146,7 @@ class MainActivity : NoSplashAppCompatActivity() {
} }
private fun checkPluginPreferences(viewPager: ViewPager2) { private fun checkPluginPreferences(viewPager: ViewPager2) {
pluginPreferencesMenuItem?.isEnabled = (viewPager.adapter as TabPageAdapter).getPluginAt(viewPager.currentItem).preferencesId != -1 if (viewPager.currentItem > 0) pluginPreferencesMenuItem?.isEnabled = (viewPager.adapter as TabPageAdapter).getPluginAt(viewPager.currentItem).preferencesId != -1
} }
override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {