From fdaa63d5dc4e46685dc7e7d38bc0004d28f06db4 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 1 Nov 2020 11:57:46 -0800 Subject: [PATCH] Fixes error in text trimming tag --- bookwyrm/templatetags/fr_display.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templatetags/fr_display.py b/bookwyrm/templatetags/fr_display.py index 9e6e35cd..0595ff52 100644 --- a/bookwyrm/templatetags/fr_display.py +++ b/bookwyrm/templatetags/fr_display.py @@ -115,8 +115,10 @@ def get_book_description(book): @register.filter(name='text_overflow') def text_overflow(text): ''' dont' let book descriptions run for ages ''' + if not text: + return char_max = 500 - if len(text) < char_max: + if text and len(text) < char_max: return text trimmed = text[:char_max]