From 852e6ab5a0d9fb0a263b04a1f735caf3096dcdab Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 9 Nov 2022 17:41:32 +0000 Subject: [PATCH] Fix crash in phpbbparser --- app/utils/phpbbparser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/utils/phpbbparser.py b/app/utils/phpbbparser.py index 4e847339..ab16705e 100644 --- a/app/utils/phpbbparser.py +++ b/app/utils/phpbbparser.py @@ -138,7 +138,11 @@ def parseForumListPage(id, page, out, extra=None): left = topic.find(class_="topic-poster") date = left.find("time").get_text() date = datetime.strptime(date, "%a %b %d, %Y %H:%M") - author = left.find_all("a")[-1].get_text().strip() + links = left.find_all("a") + if len(links) == 0: + continue + + author = links[-1].get_text().strip() # Get counts posts = topic.find(class_="posts").find(text=True)