From e243458338bce25f015a9dff7dcf363feae09929 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 10 Feb 2023 15:45:36 +0200 Subject: [PATCH] fix 500 error --- files/routes/posts.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 6563b1df0..194785bc5 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -166,7 +166,8 @@ def post_id(pid, anything=None, v=None, sub=None): post.views += 1 g.db.add(post) - y, output = get_comments_v_properties(v, True, None, Comment.top_comment_id.in_(ids), Comment.level < 10) + if v: + y, output = get_comments_v_properties(v, True, None, Comment.top_comment_id.in_(ids), Comment.level < 10) if v and v.client: return post.json(g.db)