Merge pull request #1478 from laurent22/master

Throw an error instead of crashing app when video source is empty
This commit is contained in:
Hampton Maxwell 2019-02-18 21:27:40 -08:00 committed by GitHub
commit 98eb7a3137
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,6 +226,8 @@ export default class Video extends Component {
if (uri && uri.match(/^\//)) {
uri = `file://${uri}`;
}
if (!uri) throw new Error('Trying to load empty source.');
const isNetwork = !!(uri && uri.match(/^https?:/));
const isAsset = !!(uri && uri.match(/^(assets-library|ipod-library|file|content|ms-appx|ms-appdata):/));