add callback with null argument to failed xml load (#2994)

This commit is contained in:
Andrea Bogazzi 2016-05-21 14:34:17 +02:00
parent f425966162
commit 489230bdf5

View file

@ -981,7 +981,7 @@
xml.loadXML(r.responseText.replace(/<!DOCTYPE[\s\S]*?(\[[\s\S]*\])*?>/i, ''));
}
if (!xml || !xml.documentElement) {
return;
callback && callback(null);
}
fabric.parseSVGDocument(xml.documentElement, function (results, options) {
@ -989,7 +989,7 @@
objects: fabric.util.array.invoke(results, 'toObject'),
options: options
});
callback(results, options);
callback && callback(results, options);
}, reviver);
}
},