Skip to content

Commit

Permalink
Fixed maximum call stack exceeded error while deserializing tweets wi…
Browse files Browse the repository at this point in the history
…th quoted
  • Loading branch information
Rishikant181 committed Oct 17, 2024
1 parent 8cc290f commit b4a76f2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/models/data/Tweet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,10 @@ export class Tweet {
}
// If normal tweet
else if (tweet.quoted_status_result && Object.entries(tweet.quoted_status_result).length) {
return new Tweet(tweet);
return new Tweet(tweet.quoted_status_result.result as ITweet);
}
// Else, skip
else {
// Logging
LogService.log(ELogActions.WARNING, {
action: ELogActions.DESERIALIZE,
message: 'Quoted tweet not found, skipping',
});

return undefined;
}
}
Expand All @@ -137,12 +131,6 @@ export class Tweet {
}
// Else, skip
else {
// Logging
LogService.log(ELogActions.WARNING, {
action: ELogActions.DESERIALIZE,
message: 'Retweeted tweet not found, skipping',
});

return undefined;
}
}
Expand Down

0 comments on commit b4a76f2

Please sign in to comment.