Hi,
I think you have a fair point. Currently Tweetinvi follows the Twitter API which when a retweet is received has the Media field set to null.
Consequently you are trying to access the .Count field of an object which is not referenced.
I might reconsider how to manage null in later versions.
Concerning your issue, I believe this code should work:
Linvi
I think you have a fair point. Currently Tweetinvi follows the Twitter API which when a retweet is received has the Media field set to null.
Consequently you are trying to access the .Count field of an object which is not referenced.
I might reconsider how to manage null in later versions.
Concerning your issue, I believe this code should work:
stream.StartStream(token, tweet => {
if (tweet.Media != null && tweet.Media.Any())
{
Console.WriteLine(tweet.Media[0].MediaURL);
AddTweet(ref tweet);
tweet.PublishRetweet();
}
else
{
Console.WriteLine("no url");
}
return 1 == 1;
});
Kind Regards,Linvi