Adding validation and error handling if no marker is passed

This commit is contained in:
Pavle Goloskokovic 2017-11-23 12:31:34 +01:00
parent 084d309efb
commit 40b4dc2e6e

View file

@ -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;
},