diff --git a/src/plugins/docgen/HtmlDoc.py b/src/plugins/docgen/HtmlDoc.py
index dc391f6ae..926205a55 100644
--- a/src/plugins/docgen/HtmlDoc.py
+++ b/src/plugins/docgen/HtmlDoc.py
@@ -284,8 +284,10 @@ class HtmlDoc(BaseDoc, TextDoc):
tdfile.close()
#css file
if self.css_filename:
- self.copy_file(os.path.join(const.DATA_DIR, self.css_filename),
- _HTMLSCREEN)
+ #we do an extra check in case file does not exist, eg cli call
+ fullpath = os.path.join(const.DATA_DIR, self.css_filename)
+ if os.path.exists(fullpath):
+ self.copy_file(fullpath, _HTMLSCREEN)
#favicon
self.copy_file(os.path.join(const.IMAGE_DIR, 'favicon.ico'),
'favicon.ico')