mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2024-11-10 09:07:47 +01:00
fix: add bounds checks in patch selector
This commit is contained in:
parent
5455cf20ab
commit
a12c5c583b
1 changed files with 3 additions and 1 deletions
|
@ -285,7 +285,7 @@ fun PatchesSelectorScreen(
|
|||
ExtendedFloatingActionButton(
|
||||
text = { Text(stringResource(R.string.save)) },
|
||||
icon = { Icon(Icons.Outlined.Save, null) },
|
||||
expanded = patchLazyListStates[pagerState.currentPage].isScrollingUp,
|
||||
expanded = patchLazyListStates.getOrNull(pagerState.currentPage)?.isScrollingUp ?: true,
|
||||
onClick = {
|
||||
// TODO: only allow this if all required options have been set.
|
||||
onSave(vm.getCustomSelection(), vm.getOptions())
|
||||
|
@ -325,6 +325,8 @@ fun PatchesSelectorScreen(
|
|||
state = pagerState,
|
||||
userScrollEnabled = true,
|
||||
pageContent = { index ->
|
||||
// Avoid crashing if the lists have not been fully initialized yet.
|
||||
if (index > bundles.lastIndex || bundles.size != patchLazyListStates.size) return@HorizontalPager
|
||||
val bundle = bundles[index]
|
||||
|
||||
LazyColumnWithScrollbar(
|
||||
|
|
Loading…
Reference in a new issue