Skip to content

Commit 79e77b6

Browse files
committed
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.
1 parent 89e41a1 commit 79e77b6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/tweetConstructor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ async function constructTweet(t, tweetConstructorArgs, options = {}) {
669669
// Main text content
670670
const longShortClass =
671671
vars.noBigFont ||
672-
t.full_text.length > 280 ||
672+
(t.full_text?.length ?? 0) > 280 ||
673673
!options.bigFont ||
674674
(!options.mainTweet && location.pathname.includes("/status/"))
675675
? "tweet-body-text-long"

0 commit comments

Comments
 (0)