From a3f555c23af8d6b0c5c57778bc23ecfe0d6b114e Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 25 Mar 2023 20:32:31 +0200 Subject: [PATCH] fix 500 error --- files/helpers/sanitize.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index e411d5875..0be5b5607 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -639,6 +639,7 @@ def complies_with_chud(obj): #torture body_html tags = soup.html.body.find_all(lambda tag: tag.name not in {'blockquote','codeblock','pre'}, recursive=False) for tag in tags: + if not tag.string: continue tag.string.replace_with(torture_ap(tag.text, obj.author.username)) obj.body_html = str(soup)