mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Adding validation and error handling if no marker is passed
This commit is contained in:
parent
084d309efb
commit
40b4dc2e6e
1 changed files with 4 additions and 0 deletions
|
@ -138,6 +138,10 @@ var BaseSound = new Class({
|
|||
},
|
||||
// TODO set default methods to NOOP if not used
|
||||
addMarker: function (marker) {
|
||||
if (!marker) {
|
||||
console.error('Marker object has to be provided to \'addMarker\' method!');
|
||||
return false;
|
||||
}
|
||||
this.markers[marker.name] = marker;
|
||||
return false;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue