mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 22:12:48 -05:00
check if no sound at index before playing
This commit is contained in:
parent
9731a58f0b
commit
3a9e6b8634
1 changed files with 2 additions and 0 deletions
|
@ -108,6 +108,8 @@ AudioPlayer.prototype.loadSounds = function (sounds) {
|
||||||
};
|
};
|
||||||
|
|
||||||
AudioPlayer.prototype.playSound = function (index) {
|
AudioPlayer.prototype.playSound = function (index) {
|
||||||
|
if (!this.soundPlayers[index]) return;
|
||||||
|
|
||||||
this.soundPlayers[index].start();
|
this.soundPlayers[index].start();
|
||||||
|
|
||||||
var storedContext = this;
|
var storedContext = this;
|
||||||
|
|
Loading…
Reference in a new issue