From 8d2da587d990c03c131b3bf8ab7e2d65e370c42b Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 16 May 2022 11:06:11 -0700 Subject: [PATCH] Prevent error when a book language has a null value --- bookwyrm/models/book.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index 3ea8e1a8..19004601 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -176,8 +176,8 @@ class Book(BookDataModel): """properties of this edition, as a string""" items = [ self.physical_format if hasattr(self, "physical_format") else None, - self.languages[0] + " language" - if self.languages and self.languages[0] != "English" + f"{self.languages[0]} language" + if self.languages and self.languages[0] and self.languages[0] != "English" else None, str(self.published_date.year) if self.published_date else None, ", ".join(self.publishers) if hasattr(self, "publishers") else None,