Skip to content

Commit

Permalink
add callback with null argument to failed xml load (#2994)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed May 21, 2016
1 parent f425966 commit 489230b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,15 +981,15 @@
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) {
svgCache.set(url, {
objects: fabric.util.array.invoke(results, 'toObject'),
options: options
});
callback(results, options);
callback && callback(results, options);
}, reviver);
}
},
Expand Down

0 comments on commit 489230b

Please sign in to comment.