diff --git a/src/shapes/image.class.js b/src/shapes/image.class.js index 902827f7276..25093787f20 100644 --- a/src/shapes/image.class.js +++ b/src/shapes/image.class.js @@ -628,7 +628,11 @@ * @param {Function} callback Callback to invoke when an image instance is created */ fabric.Image.fromObject = function(object, callback) { - fabric.util.loadImage(object.src, function(img) { + fabric.util.loadImage(object.src, function(img, error) { + if (error) { + callback && callback(null, error); + return; + } fabric.Image.prototype._initFilters.call(object, object.filters, function(filters) { object.filters = filters || []; fabric.Image.prototype._initFilters.call(object, object.resizeFilters, function(resizeFilters) { diff --git a/src/util/misc.js b/src/util/misc.js index 7b74fc69676..78a3b378f81 100644 --- a/src/util/misc.js +++ b/src/util/misc.js @@ -328,10 +328,8 @@ var klass = fabric.util.getKlass(o.type, namespace); if (klass.async) { klass.fromObject(o, function (obj, error) { - if (!error) { - enlivenedObjects[index] = obj; - reviver && reviver(o, enlivenedObjects[index]); - } + enlivenedObjects[index] = obj; + reviver && reviver(o, enlivenedObjects[index], error); onLoaded(); }); }