mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 22:18:29 +00:00
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:
commit
56179c3887
2 changed files with 2 additions and 6 deletions
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue