mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-19 21:29:36 +08:00
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:
committed by
facebook-github-bot-4
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, {
|
||||
|
||||
Reference in New Issue
Block a user