1
0
mirror of https://github.com/GNS3/gns3-server synced 2025-01-11 08:30:57 +00:00

Handle some invalid svg

Fix #944
This commit is contained in:
Julien Duponchelle 2017-03-16 18:39:07 +01:00
parent 490576fedc
commit 7c318d477d
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -99,8 +99,8 @@ def get_size(data, default_width=0, default_height=0):
root = tree.getroot()
try:
width = _svg_convert_size(root.attrib["width"])
height = _svg_convert_size(root.attrib["height"])
width = _svg_convert_size(root.attrib.get("width", 0))
height = _svg_convert_size(root.attrib.get("height", 0))
except IndexError:
raise ValueError("Invalid SVG file")