From 3817bd03bb32fd513c7a04f522c1a7993ad510d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Wed, 26 Feb 2025 10:04:57 +0100 Subject: [PATCH 1/2] fix: don't crash when no elements are found --- .../android/src/main/java/com/rcttabview/RCTTabView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt b/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt index 10719ba7..4719d1d8 100644 --- a/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt +++ b/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt @@ -423,7 +423,7 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) { private fun updateTintColors() { // First let's check current item color. - val currentItemTintColor = items.first { it.key == selectedItem }.activeTintColor + val currentItemTintColor = items.firstOrNull { it.key == selectedItem }?.activeTintColor // getDefaultColor will always return a valid color but to satisfy the compiler we need to check for null val colorPrimary = currentItemTintColor ?: activeTintColor ?: Utils.getDefaultColorFor( From 7fc7d1ad1bb3ebec919588b9a619763ad8586921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwa=C5=9Bniewski?= Date: Wed, 26 Feb 2025 10:06:01 +0100 Subject: [PATCH 2/2] Create metal-rocks-shop.md --- .changeset/metal-rocks-shop.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/metal-rocks-shop.md diff --git a/.changeset/metal-rocks-shop.md b/.changeset/metal-rocks-shop.md new file mode 100644 index 00000000..85a83b05 --- /dev/null +++ b/.changeset/metal-rocks-shop.md @@ -0,0 +1,5 @@ +--- +"react-native-bottom-tabs": patch +--- + +fix(android): don't crash when no elements are found