[ReactNative] Do not throw when Image.source is null

This commit is contained in:
Alex Kotliarskyi 2015-05-06 15:51:59 -07:00
parent ee449301b6
commit d3c0029cef
1 changed files with 1 additions and 2 deletions

View File

@ -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]);