Added validation for invalid marker name to updateMarker method

This commit is contained in:
Pavle Goloskokovic 2017-11-23 12:56:06 +01:00
parent 42735ee09f
commit 0e97a18553

View file

@ -172,6 +172,10 @@ var BaseSound = new Class({
console.error('updateMarker - Marker object has to be provided!');
return false;
}
if (!marker.name || typeof marker.name !== 'string') {
console.error('updateMarker - Marker has to have a valid name!');
return false;
}
this.markers[marker.name] = Extend(true, this.markers[marker.name], marker);
return true;
},