diff --git a/CoverPages.py b/CoverPages.py index 7354899..f2e1932 100644 --- a/CoverPages.py +++ b/CoverPages.py @@ -39,10 +39,13 @@ class CoverPages(object): for row in rows: url = '/' + row.filename href = '/ebooks/%d' % row.pk - title = gg.xmlspecialchars (row.title) # handles <,>,& - #Shortening long titles for latest covers - title = title.replace('"', '"') - title = title.replace("'", ''') + if row.title: + title = gg.xmlspecialchars (row.title) # handles <,>,& + #Shortening long titles for latest covers + title = title.replace('"', '"') + title = title.replace("'", ''') + else: + title = '!! missing title !!' short_title = title title_len = len(title) short_title = re.sub(r"\-+", " ", short_title)