mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-22 07:10:59 +00:00
Don't crash trying to fetch parents we don't have
This commit is contained in:
parent
d1e398a7b7
commit
12a838eb0e
1 changed files with 2 additions and 0 deletions
|
@ -67,6 +67,8 @@ class PostService:
|
|||
ancestor = self.post
|
||||
while ancestor.in_reply_to and len(ancestors) < num_ancestors:
|
||||
ancestor = cast(Post, ancestor.in_reply_to_post())
|
||||
if ancestor is None:
|
||||
break
|
||||
if ancestor.state in [PostStates.deleted, PostStates.deleted_fanned_out]:
|
||||
break
|
||||
ancestors.append(ancestor)
|
||||
|
|
Loading…
Reference in a new issue