Skip to content

Commit

Permalink
Merge pull request TheWidlarzGroup#1478 from laurent22/master
Browse files Browse the repository at this point in the history
Throw an error instead of crashing app when video source is empty
  • Loading branch information
cobarx authored Feb 19, 2019
2 parents b448b30 + 891add6 commit 98eb7a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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):/));
Expand Down

0 comments on commit 98eb7a3

Please sign in to comment.