Skip to content

plt_draw_text can raise AttributeError on SVG Text nodes #23

@szmoore

Description

@szmoore

Calling load on a SVG file with <text ...> nodes

  File "/usr/local/lib/python3.7/dist-packages/pylustrator/parse_svg.py", line 643, in parseGroup
    patch_list.append(plt_draw_text(child, trans, style, ids, no_draw=no_draw))
  File "/usr/local/lib/python3.7/dist-packages/pylustrator/parse_svg.py", line 330, in plt_draw_text
    text_content += child.firstChild.nodeValue
AttributeError: 'NoneType' object has no attribute 'nodeValue'

This PR would fix it but I'm not sure if it would break the original use case, which might have been parsing a very different file.
szmoore#1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions