Open kieron opened 4 years ago
That means the returned object was undefined, and undefined.screen_name
is not a valid property in JavaScript.
What was your code that fetched that object?
Oh! I've been doing this to try and stop the issue, but perhaps a pointless effort, (stripped out a lot of unrelated stuff)
stream.on("data", function(tweet) {
tweetObj = {
screenName: getName(tweet),
}
// do stuff with tweetObj (which would have, text, time, etc (all tweet components))
});
function getName(tweet) {
if (tweet.user.hasOwnProperty("screen_name")) {
return tweet.user.screen_name
}
else if (tweet.user.hasOwnProperty("name")) {
return tweet.user.name
}
else {
return "Name Null"
}
}
Hey, sorry just got this and wondered if anyone knows what it means, is it saying that the account doesn't have a
screen_name
? I thought that would be impossible!It doesn't happen all the time, just occasionally.
Many thanks!