Skip to content

Commit

Permalink
Fix deleted posts in thread chain causing crash
Browse files Browse the repository at this point in the history
  • Loading branch information
dangeredwolf committed Nov 17, 2024
1 parent 0b75206 commit 9f2401d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/providers/bsky/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const followReplyChain = (thread: BlueskyThread): BlueskyPost[] => {

for (const _post of thread.replies) {
const post = _post.post;
if (post.author.did !== thread.post.author.did) {
if (!post || post.author.did !== thread.post.author.did) {
continue;
}
console.log('checking post', post);
Expand Down Expand Up @@ -78,7 +78,7 @@ export const constructBlueskyThread = async (
// loop through chain of parents
if (thread.parent) {
let parent = thread.parent;
while (parent) {
while (parent && parent?.post) {
bucket.unshift(parent.post);
parent = parent.parent;
}
Expand Down

0 comments on commit 9f2401d

Please sign in to comment.