Skip to content

Commit 4676188

Browse files
RuudBurgerclaude
andcommitted
fix: remove non-null assertion on getFirstFocusableView return value
The !! operator caused a NullPointerException crash when no focusable element was found in a view group. All callers already handle null. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 863bd33 commit 4676188

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ public open class ReactViewGroup public constructor(context: Context?) :
631631
index++
632632
}
633633

634-
return firstFocusableElement!!
634+
return firstFocusableElement
635635
}
636636

637637
private fun moveFocusToFirstFocusable(viewGroup: ReactViewGroup): Boolean {

0 commit comments

Comments
 (0)