weired tweet.user is undefined
mawnir opened this issue · comments
mawnir commented
With this tweet id = '1716120243775402095' => "This Post is from an account that no longer exists"
I get this error: 'TypeError: tweet.user is undefined'
my code:
const { data, error, isLoading } = useSWR('/api/tweets/' + tweetId, fetcher);
if (isLoading) {
return (<TweetSkeleton />)
}
else if (error) {
return null// (<TweetNotFound />)
} else {
//console.log(data.data);
if (data.data) {
const tweet = enrichTweet(data.data); <== Problem here
how can i check this before hand?