Fix crash when you import a corrupted SVG

Fix #746
pull/774/head
Julien Duponchelle 8 years ago
parent 4a5066c2a5
commit 53e6ee1b3a
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

@ -92,7 +92,11 @@ class Drawing:
self._svg = value
return
root = ET.fromstring(value)
try:
root = ET.fromstring(value)
except ET.ParseError as e:
log.error("Can't parse SVG: {}".format(e))
return
# SVG is the default namespace no need to prefix it
ET.register_namespace('xmlns', "http://www.w3.org/2000/svg")
ET.register_namespace('xmlns:xlink', "http://www.w3.org/1999/xlink")

Loading…
Cancel
Save