Hello,
The coordinates are not always available in a Tweet.
Lots of users decide to not publish their coordinates as part of their public tweets.
Therefore you need to always check if the Coordinates property of a tweet is not null.
Linvi
The coordinates are not always available in a Tweet.
Lots of users decide to not publish their coordinates as part of their public tweets.
Therefore you need to always check if the Coordinates property of a tweet is not null.
privatestaticvoid TwitterStream() { var stream = Stream.CreateSampleStream(); stream.TweetReceived += (sender, args) => { var tweet = args.Tweet; var hasUserPublishedWithLocation = tweet.Coordinates != null; if (hasUserPublishedWithLocation) { Console.WriteLine(tweet.Coordinates.Latitude); } }; stream.StartStream(); }