jonathantneal/svg4everybody

Missing src throws

fjozsef opened this issue · 2 comments

It throws an error if there is an svg use with missing xlink:href / href (which shouldn't be polyfilled).

svg4everybody.js:64 Uncaught TypeError: Cannot read property 'split' of null
    at oninterval (svg4everybody.js:64)
    at svg4everybody (svg4everybody.js:100)
    at <anonymous>:1:2

In addition, if src var is null, the <use> tag of the first matching svg is removed entirely before the script fails. Possible scenario is when neither getAttribute xlink:href or href return anything but null.

Tests showed some browsers acted just like that and only returned the correct value when getAttributeNS was used (even though using that is technically not proper for HTML5).

Fixed in 3850089