diff --git a/cairosvg/parser.py b/cairosvg/parser.py index f9c546db..84ccbaa0 100644 --- a/cairosvg/parser.py +++ b/cairosvg/parser.py @@ -393,7 +393,7 @@ def __init__(self, **kwargs): (url and url.startswith('#') and not self.url)) if self_is_parent: root_parent = parent - while root_parent.parent: + while root_parent.parent is not None: root_parent = root_parent.parent tree = root_parent.xml_tree else: