mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-18 21:20:59 +00:00
Fix loadFromJSON 404s breaking fabric (Pattern)
Prevent image 404s in patterns from loadFromJSON from breaking everything trying to get attributes of a source which is null, while passing it upwards to allow dealing with images which failed to load outside of Fabric.JS
This commit is contained in:
parent
eb919f9a04
commit
f2943ef2bb
1 changed files with 5 additions and 0 deletions
|
|
@ -137,6 +137,11 @@ fabric.Pattern = fabric.util.createClass(/** @lends fabric.Pattern.prototype */
|
|||
? this.source()
|
||||
: this.source;
|
||||
|
||||
// if the image failed to load, return, and allow rest to continue loading
|
||||
if (!source){
|
||||
return '';
|
||||
}
|
||||
|
||||
// if an image
|
||||
if (typeof source.src !== 'undefined') {
|
||||
if (!source.complete) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue