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:
Janic Duplessis 2016-01-18 13:56:19 -08:00 committed by facebook-github-bot-4
parent 3453a60bf8
commit bd4bf8ca39
1 changed files with 3 additions and 0 deletions

View File

@ -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, {