Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

Closed Issue: Null Exception - Value cannot be null. Parameter name: source [2472]

$
0
0
Hi there,

I am experiencing some inconsistent behavior when utilizing the library. I am trying to retrieve tweets as so:

```
private IOAuthCredentials Credentials { get; set; }

//class constructor
public Twit()
{
Credentials = TwitterCredentials.CreateCredentials(
"...",
"...",
"...",
"..."
);
}

//function call which throws error
public List<ITweet> SearchInPosts(string query)
{
List<ITweet> inPosts = new List<ITweet>();

TwitterCredentials.ExecuteOperationWithCredentials(Credentials, () =>
{
var searchParam = Search.GenerateSearchTweetParameter(query);
searchParam.Lang = Language.English;
searchParam.MaximumNumberOfResults = 1000;
searchParam.TweetSearchFilter = TweetSearchFilter.OriginalTweetsOnly;
inPosts = Search.SearchTweets(searchParam); //ERROR comes from searchParam
});

return inPosts;
}
```

I'm losing my mind trying to solve this problem. I get a proper return the first few tries, then subsequently after that, I encounter this error. It also seems that I have to wait a certain amount of time to have it work again, but that may be my imagination. There also appears to be no attribute for "name" in searchParam, which leads to more confusion on my part.

I have also tried using "SetCredentials" as described in [this post](https://tweetinvi.codeplex.com/workitem/2225), but still no luck.

Am I using the library correctly? Or am I missing something completely?

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>