Work on Android even if style is not passed in

Otherwise we get a "Cannot read property 'borderRadius' of undefined" since [flattenStyle() will return undefined](62e8ddc205/Libraries/StyleSheet/flattenStyle.js (L28)) if style is undefined.
This commit is contained in:
Martin Lundberg 2016-02-22 09:53:09 +01:00
parent eed84a2dd5
commit fcb8deac05
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ var LinearGradient = React.createClass({
// inherit container borderRadius until this issue is resolved:
// https://github.com/facebook/react-native/issues/3198
var borderRadius = flattenStyle(style).borderRadius || 0;
var borderRadius = style && flattenStyle(style).borderRadius || 0;
return (
<View {...otherProps} style={style}>