Skip to content

Commit 13c633f

Browse files
committed
fix: add defensive check to CustomTabRowWithSpacing tab index calc
1 parent d40289c commit 13c633f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/src/main/java/to/bitkit/ui/screens/wallets/activity/components/CustomTabRowWithSpacing.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ fun <T : TabItem> CustomTabRowWithSpacing(
4040
horizontalArrangement = Arrangement.SpaceEvenly,
4141
modifier = Modifier.fillMaxWidth()
4242
) {
43+
val safeIndex = currentTabIndex.coerceIn(0, tabs.lastIndex)
4344
tabs.forEachIndexed { index, tab ->
44-
val isSelected = tabs[currentTabIndex] == tab
45+
val isSelected = tabs[safeIndex] == tab
4546

4647
Column(
4748
modifier = Modifier.weight(1f)

0 commit comments

Comments
 (0)