Fix a crash in ViewPagerAndroid when passing a null child
Summary: Fixes #5195 Closes https://github.com/facebook/react-native/pull/5236 Reviewed By: svcscm Differential Revision: D2819197 Pulled By: androidtrunkagent fb-gh-sync-id: cea451802c659512f64c1e90905647b8fbe4490b
This commit is contained in:
parent
3453a60bf8
commit
bd4bf8ca39
|
@ -112,6 +112,9 @@ var ViewPagerAndroid = React.createClass({
|
|||
// will handle positioning of elements, so it's not important to offset
|
||||
// them correctly.
|
||||
return React.Children.map(this.props.children, function(child) {
|
||||
if (!child) {
|
||||
return null;
|
||||
}
|
||||
var newProps = {
|
||||
...child.props,
|
||||
style: [child.props.style, {
|
||||
|
|
Loading…
Reference in New Issue