Skip to content

Commit 496c571

Browse files
empratyushthestinger
authored andcommitted
avoid crashes in rare case when tabParent is not initialized
``` Exception b5.e: lateinit property tabParent has not been initialized at app.grapheneos.camera.ui.BottomTabLayout.centerTab (BottomTabLayout.kt) at app.grapheneos.camera.ui.activities.MainActivity.finalizeMode (MainActivity.kt) ```
1 parent c6c560e commit 496c571

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

app/src/main/java/app/grapheneos/camera/ui/BottomTabLayout.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class BottomTabLayout @JvmOverloads constructor(
9494
}
9595

9696
fun centerTab(tab: Tab) {
97+
if (!this::tabParent.isInitialized) return
9798
val targetScrollX = calculateScrollXForTab(tab.position)
9899

99100
if (scrollX != targetScrollX)

0 commit comments

Comments
 (0)