Merge pull request #4920 from samme/feature/error-for-missing-audio-source

Throw an error when adding a sound from a missing asset
This commit is contained in:
Richard Davey 2019-12-28 16:37:52 +00:00 committed by GitHub
commit 56179c3887
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -47,9 +47,7 @@ var HTML5AudioSound = new Class({
if (!this.tags)
{
// eslint-disable-next-line no-console
console.warn('Audio cache entry missing: ' + key);
return;
throw new Error('There is no audio asset with key "' + key + '" in the audio cache');
}
/**

View file

@ -45,9 +45,7 @@ var WebAudioSound = new Class({
if (!this.audioBuffer)
{
// eslint-disable-next-line no-console
console.warn('Audio cache entry missing: ' + key);
return;
throw new Error('There is no audio asset with key "' + key + '" in the audio cache');
}
/**