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) {