From 04404a2f4fc986ea02a606d4faead6eca0e0e541 Mon Sep 17 00:00:00 2001 From: Toshiaki Baba Date: Sun, 3 May 2015 00:45:17 +0900 Subject: [PATCH] avoid AttributeError: 'NoneType' object has no attribute 'append' --- lpod/document.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()