Skip to content

Commit

Permalink
fix: resolve android crash issue if props are undefined (#571)
Browse files Browse the repository at this point in the history
  • Loading branch information
gamingumar authored Jun 10, 2024
1 parent 4ae337c commit 243ead2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/PickerAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,10 @@ function PickerAndroid(props: PickerAndroidProps, ref: PickerRef): React.Node {
const children = React.Children.toArray(props.children).filter(
(item) => item != null,
);
const value = children[position].props.value;
onValueChange(value, position);
const value = children[position]?.props?.value;
if (value) {
onValueChange(value, position);
}
} else {
onValueChange(null, position);
}
Expand Down

0 comments on commit 243ead2

Please sign in to comment.