[ReactNative] Do not throw when Image.source is null
This commit is contained in:
parent
ee449301b6
commit
d3c0029cef
|
@ -123,8 +123,7 @@ var Image = React.createClass({
|
||||||
'not be set directly on Image.');
|
'not be set directly on Image.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var source = resolveAssetSource(this.props.source);
|
var source = resolveAssetSource(this.props.source) || {};
|
||||||
invariant(source, 'source must be initialized');
|
|
||||||
|
|
||||||
var {width, height} = source;
|
var {width, height} = source;
|
||||||
var style = flattenStyle([{width, height}, styles.base, this.props.style]);
|
var style = flattenStyle([{width, height}, styles.base, this.props.style]);
|
||||||
|
|
Loading…
Reference in New Issue