only runs callback if it's been defined

This commit is contained in:
Francisco Dans 2015-04-15 14:53:10 +02:00
parent 27d983d646
commit f775df9e9c

View File

@ -460,7 +460,7 @@
map_instance_time.end(); map_instance_time.end();
if (data) { if (data) {
if (data.errors){ if (data.errors){
self.options.errorCallback(data.errors); self.options.errorCallback && self.options.errorCallback(data.errors);
return; return;
} }
var torque_key = Object.keys(data.metadata.torque)[0] var torque_key = Object.keys(data.metadata.torque)[0]