File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " react-native-bottom-tabs " : patch
3
+ ---
4
+
5
+ fix(android): don't crash when no elements are found
Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) {
423
423
424
424
private fun updateTintColors () {
425
425
// First let's check current item color.
426
- val currentItemTintColor = items.first { it.key == selectedItem }.activeTintColor
426
+ val currentItemTintColor = items.firstOrNull { it.key == selectedItem }? .activeTintColor
427
427
428
428
// getDefaultColor will always return a valid color but to satisfy the compiler we need to check for null
429
429
val colorPrimary = currentItemTintColor ? : activeTintColor ? : Utils .getDefaultColorFor(
You can’t perform that action at this time.
0 commit comments