Skip to content

Commit

Permalink
Merge pull request #1905 from zhourunlai/fix_twitter_undefined_proper…
Browse files Browse the repository at this point in the history
…ties

fix: twitter result obj undefined properties
  • Loading branch information
lalalune authored Jan 6, 2025
2 parents ccbc0b1 + 83dbe75 commit 0b6c745
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/client-twitter/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ export async function sendTweet(

const body = await result.json();
const tweetResult = isLongTweet
? body.data.notetweet_create.tweet_results.result
: body.data.create_tweet.tweet_results.result;
? body?.data?.notetweet_create?.tweet_results?.result
: body?.data?.create_tweet?.tweet_results?.result;

// if we have a response
if (tweetResult) {
Expand Down

0 comments on commit 0b6c745

Please sign in to comment.