From 380ca2f269b273c76fa4d98597a6eb32fb6b4fa8 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 22 Sep 2024 01:18:08 +0800 Subject: [PATCH] fix: null data in twitter --- lib/routes/twitter/api/web-api/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/routes/twitter/api/web-api/utils.ts b/lib/routes/twitter/api/web-api/utils.ts index f52c3442e9f740..d1e05ebecd8b45 100644 --- a/lib/routes/twitter/api/web-api/utils.ts +++ b/lib/routes/twitter/api/web-api/utils.ts @@ -153,9 +153,9 @@ export const paginationTweets = async (endpoint: string, userId: number | undefi } } - const entries1 = instructions.find((i) => i.type === 'TimelineAddToModule')?.moduleItems; // Media - const entries2 = instructions.find((i) => i.type === 'TimelineAddEntries').entries; - return entries1 || entries2; + const entries1 = instructions?.find((i) => i.type === 'TimelineAddToModule')?.moduleItems; // Media + const entries2 = instructions?.find((i) => i.type === 'TimelineAddEntries').entries; + return entries1 || entries2 || []; }; export function gatherLegacyFromData(entries: any[], filterNested?: string[], userId?: number | string) {