mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-01 09:15:06 +08:00
[ReactNative] Do not throw when Image.source is null
This commit is contained in:
@@ -123,8 +123,7 @@ var Image = React.createClass({
|
||||
'not be set directly on Image.');
|
||||
}
|
||||
}
|
||||
var source = resolveAssetSource(this.props.source);
|
||||
invariant(source, 'source must be initialized');
|
||||
var source = resolveAssetSource(this.props.source) || {};
|
||||
|
||||
var {width, height} = source;
|
||||
var style = flattenStyle([{width, height}, styles.base, this.props.style]);
|
||||
|
||||
Reference in New Issue
Block a user