mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
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:
committed by
facebook-github-bot-4
parent
463b072dac
commit
95a4f441e0
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user