Skip to content

Commit

Permalink
Prevent game crash on unknown sound name
Browse files Browse the repository at this point in the history
  • Loading branch information
glecollinet committed Mar 2, 2012
1 parent 1beee96 commit 7d9e2b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/js/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ define(['area'], function(Area) {
},*/

getSound: function(name) {
if(!this.sounds[name]) {
return null;
}
var sound = _.detect(this.sounds[name], function(sound) {
return sound.ended || sound.paused;
});
Expand Down

0 comments on commit 7d9e2b8

Please sign in to comment.