Silently (warning) fail when <Image> source has empty uri

Summary: fixes #3127
Closes https://github.com/facebook/react-native/pull/3185

Reviewed By: @​svcscm

Differential Revision: D2507588

Pulled By: @nicklockwood
This commit is contained in:
Dral
2015-10-05 03:59:02 -07:00
committed by facebook-github-bot-4
parent 463b072dac
commit 95a4f441e0
3 changed files with 18 additions and 0 deletions

View File

@@ -113,6 +113,14 @@ var Image = React.createClass({
render: function() {
var source = resolveAssetSource(this.props.source);
// As opposed to the ios version, here it render `null`
// when no source or source.uri... so let's not break that.
if (source && source.uri === '') {
console.warn('source.uri should not be an empty string');
}
if (source && source.uri) {
var isNetwork = source.uri.match(/^https?:/);
invariant(