Twitterizer/Twitterizer — Issue #7: Twitterizer not working when a tweet contains an image/pic
Author: DigitallyBorn
Created: 2012-03-05 16:09:12+00:00
State: open

This was sent in by Paul Stoker via email:

> I have noticed a problem with Twitterizer in that it's has been working fine until my client added a tweet to her account containing an image powered by Photobucket.
> Then we started getting the Object reference error above. It's taken a an hour or two to determine that it was actually the tweet causing the issue which I've now removed however how can I get round this problem?
> My code is below which is a very basic solution for pulling the time line in:

```
OAuthTokens tokens = new OAuthTokens();
tokens.AccessToken = AccessToken;
tokens.AccessTokenSecret = AccessTokenSecret;
tokens.ConsumerKey = ConsumerKey;
tokens.ConsumerSecret = ConsumerSecret;

try
{
UserTimelineOptions opts = new UserTimelineOptions();
opts.IncludeRetweets = false;
opts.UseSSL = true;
opts.Count = 5;

TwitterResponse timeLine = TwitterTimeline.UserTimeline(tokens, opts);
uxTweets.DataSource = timeLine.ResponseObject;
uxTweets.DataBind();
}
catch
{
uxError.Text = "

Twitter isn't configured correctly. Twitter is not responding.

";
}
```