From eb565e689a8eb0f75d493509c33cd3db7814bbb2 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Tue, 21 May 2024 00:02:45 -0400 Subject: [PATCH] Fix rare issue with malformed expanded link data --- src/helpers/linkFixer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/linkFixer.ts b/src/helpers/linkFixer.ts index b9c594f..acf32c4 100644 --- a/src/helpers/linkFixer.ts +++ b/src/helpers/linkFixer.ts @@ -5,7 +5,7 @@ export const linkFixer = (entities: TcoExpansion[] | undefined, text: string): s // }); if (Array.isArray(entities) && entities.length) { entities.forEach((url: TcoExpansion) => { - let newURL = url.expanded_url; + let newURL = url.expanded_url ?? url.url ?? ''; if (newURL.match(/^https:\/\/twitter\.com\/i\/web\/status\/\w+/g) !== null) { newURL = '';