meerk40t / svgelements

SVG Parsing for Elements, Paths, and other SVG Objects.
MIT License
127 stars 28 forks source link

None Type append in SVG.Parse #175

Closed tatarize closed 1 year ago

tatarize commented 2 years ago
                else:
                    s = SVGElement(values)  # SVG Unknown object return as element.
                    context.append(s)

Can somehow produce crash:

  File "meerk40t\svgelements.py", line 8709, in parse
AttributeError: 'NoneType' object has no attribute 'append'

There is apparently some flow which permits context to have the value None.

ptomulik commented 1 year ago

I've already seen this. Here is a minimal example, which triggers it (a file without top-level "svg" element):

<g></g>

Regards!

tatarize commented 1 year ago

And so it does...

tatarize commented 1 year ago

fixed in 1.9.0