diff --git a/lpod/document.py b/lpod/document.py index 18e54f9..831d0a2 100644 --- a/lpod/document.py +++ b/lpod/document.py @@ -603,7 +603,8 @@ def insert_style(self, style, name=None, automatic=False, default=False): # Insert it! if existing is not None: container.delete(existing) - container.append(style) + if container: + container.append(style) return style.get_name()