Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadSVGFromURL error #5252

Closed
AlexSergey opened this issue Sep 20, 2018 · 0 comments
Closed

loadSVGFromURL error #5252

AlexSergey opened this issue Sep 20, 2018 · 0 comments

Comments

@AlexSergey
Copy link
Contributor

AlexSergey commented Sep 20, 2018

Version

2.3.6

Test Case

When we try to set incorrect URL we get empty xml variable. It call callback with null, but we need prevent function, something like return false, etc. Because after callback(null) this code doesn't dying and try to call parseSVGDocument

http://joxi.ru/gmvpaj4TL85vPA

Steps to reproduce

  1. Go to http://fabricjs.com/kitchensink
  2. Set "Execute"
  3. Paste the code:
    fabric.loadSVGFromURL('https://www.cleverbrush.com/f/mu27s/w5jspy20v+.svg', objects => {
    console.log(objects);
    });

Expected Behavior

We need to get only null in console

Actual Behavior

We get also error - Cannot read property 'documentElement' of null

asturur pushed a commit that referenced this issue Sep 28, 2018
* Fix loadSVGFromURL bug
@asturur asturur closed this as completed Sep 28, 2018
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this issue Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants