From 79e77b6c65a9e423eea57fb640b0eb35ff533e53 Mon Sep 17 00:00:00 2001 From: SAY-5 Date: Mon, 11 May 2026 14:40:33 -0700 Subject: [PATCH] fix: guard constructTweet against undefined full_text The longShortClass calculation reads t.full_text.length without a guard, throwing a TypeError when a tweet object has no full_text property (observed in v1.9.6.5 during renderTimeline on profile pages). Fall back to length 0 when full_text is missing so the class assignment matches the existing short-tweet behaviour. --- scripts/tweetConstructor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tweetConstructor.js b/scripts/tweetConstructor.js index c5e2f3f0..af7bddf2 100644 --- a/scripts/tweetConstructor.js +++ b/scripts/tweetConstructor.js @@ -669,7 +669,7 @@ async function constructTweet(t, tweetConstructorArgs, options = {}) { // Main text content const longShortClass = vars.noBigFont || - t.full_text.length > 280 || + (t.full_text?.length ?? 0) > 280 || !options.bigFont || (!options.mainTweet && location.pathname.includes("/status/")) ? "tweet-body-text-long"