diff --git a/lib/svg/units.py b/lib/svg/units.py index c4ec82a02..0de410ab9 100644 --- a/lib/svg/units.py +++ b/lib/svg/units.py @@ -80,7 +80,10 @@ def convert_length(length): @cache def get_viewbox(svg): - return svg.get('viewBox').strip().replace(',', ' ').split() + viewbox = svg.get('viewBox') + if viewbox is None: + viewbox = "0 0 0 0" + return viewbox.strip().replace(',', ' ').split() @cache