diff --git a/Libraries/Image/AssetSourceResolver.js b/Libraries/Image/AssetSourceResolver.js index a240b5af716..4b4e4117f35 100644 --- a/Libraries/Image/AssetSourceResolver.js +++ b/Libraries/Image/AssetSourceResolver.js @@ -73,7 +73,7 @@ class AssetSourceResolver { } isLoadedFromFileSystem(): boolean { - return !!this.jsbundleUrl; + return !!(this.jsbundleUrl && this.jsbundleUrl.startsWith('file://')); } canLoadFromEmbeddedBundledLocation(): boolean { diff --git a/Libraries/Image/resolveAssetSource.js b/Libraries/Image/resolveAssetSource.js index aba63045e4d..bb46279af4d 100644 --- a/Libraries/Image/resolveAssetSource.js +++ b/Libraries/Image/resolveAssetSource.js @@ -43,7 +43,7 @@ function _coerceLocalScriptURL(scriptURL: ?string): ?string { return null; } scriptURL = scriptURL.substring(0, scriptURL.lastIndexOf('/') + 1); - if (!scriptURL.startsWith('file://')) { + if (!scriptURL.includes('://')) { // Add file protocol in case we have an absolute file path and not a URL. // This shouldn't really be necessary. scriptURL should be a URL. scriptURL = 'file://' + scriptURL;