From 5f497dfef8875b9381a028c16f0de04726008148 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Sat, 4 Nov 2023 03:23:15 -0400 Subject: [PATCH] Fix 404 statuses causing unexpected results --- src/providers/twitter/conversation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/providers/twitter/conversation.ts b/src/providers/twitter/conversation.ts index 13bde3b..3fc449e 100644 --- a/src/providers/twitter/conversation.ts +++ b/src/providers/twitter/conversation.ts @@ -322,9 +322,9 @@ export const constructTwitterThread = async ( const buildPost = await buildAPITweet(result, language, false, legacyAPI); - if ((buildPost as FetchResults).status === 401) { + if ((buildPost as FetchResults)?.status === 401) { return { post: null, thread: null, author: null, code: 401 }; - } else if (buildPost === null) { + } else if (buildPost === null || (buildPost as FetchResults)?.status === 404) { return { post: null, thread: null, author: null, code: 404 }; }