From c352fa63783ee6ceae689d4ce0c6ad67e2aa88bc Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 28 Feb 2017 23:07:38 +0000 Subject: [PATCH] Check that the USER_CSS directory exists --- gramps/plugins/webstuff/webstuff.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gramps/plugins/webstuff/webstuff.py b/gramps/plugins/webstuff/webstuff.py index 9cc8963f9..35e0fb0ef 100644 --- a/gramps/plugins/webstuff/webstuff.py +++ b/gramps/plugins/webstuff/webstuff.py @@ -178,11 +178,12 @@ def load_on_reg(dbstate, uistate, plugin): path_img_48x48("gramps-geo-mainmap.png"), None, [], [] ], ] # If we add css user files, we must restart gramps to use them. - list_files = os.listdir(USER_CSS) - for cssfile in list_files: - CSS_FILES.append([cssfile, 1, cssfile.replace('.css', ''), - os.path.join(USER_CSS,cssfile), - None, [], [] ]) + if os.path.exists(USER_CSS): + list_files = os.listdir(USER_CSS) + for cssfile in list_files: + CSS_FILES.append([cssfile, 1, cssfile.replace('.css', ''), + os.path.join(USER_CSS,cssfile), + None, [], [] ]) return CSS_FILES def process_list(data):