Skip to content

Commit ed1f2dd

Browse files
committed
migrate 0.0.11
Signed-off-by: ふぁ <yuki@yuki0311.com>
1 parent 06556a7 commit ed1f2dd

File tree

1 file changed

+3
-1
lines changed
  • twitter-openapi-typescript/src/utils

1 file changed

+3
-1
lines changed

twitter-openapi-typescript/src/utils/api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ export const buildTweetApiUtils = (args: buildTweetApiUtilsArgs): TweetApiUtilsD
7474
const user = userOrNullConverter(tweet.core.userResults.result);
7575
if (user == null) return undefined;
7676
const quoted = tweet.quotedStatusResult;
77-
const retweeted = tweet.legacy.retweetedStatusResult;
77+
const retweeted = tweet.legacy?.retweetedStatusResult;
78+
7879
const reply =
7980
args.reply
8081
?.map((e) => buildTweetApiUtils({ result: e.tweetResults, promotedMetadata: e.promotedMetadata }))
@@ -91,6 +92,7 @@ export const buildTweetApiUtils = (args: buildTweetApiUtilsArgs): TweetApiUtilsD
9192
};
9293

9394
export const tweetResultsConverter = (tweetResults: i.ItemResult): i.Tweet | undefined => {
95+
if (tweetResults.result == undefined) return undefined;
9496
switch (tweetResults.result.typename) {
9597
case i.TypeName.Tweet:
9698
return tweetResults.result as i.Tweet;

0 commit comments

Comments
 (0)