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

New Post: Null Exception - Value cannot be null. Parameter name: source

$
0
0
A fix has already been implemented, you can use it by downloading the Source Code. It will be available as part of Tweetinvi 0.9.4.1.
This problem happens only when an Exception has been throw by Twitter.

It means that you can fix this problem before the patch comes up.

Add a Try/Catch around your code and use the exception handler to understand what is wrong with the code.
I believe the issue here is the fact that you are reaching the RateLimit of Twitter.
TwitterCredentials.ExecuteOperationWithCredentials(Credentials, () =>
{
    var searchParam = Search.GenerateTweetSearchParameter(query);
    searchParam.Lang = Language.English;
    searchParam.MaximumNumberOfResults = 1000;
    searchParam.TweetSearchFilter = TweetSearchFilter.OriginalTweetsOnly;

    try
    {
        inPosts = Search.SearchTweets(searchParam); //ERROR comes from searchParam
    }
    catch (Exception)
    {
        var lastException = ExceptionHandler.GetLastException();
        Console.WriteLine(lastException.ToString());
    }
});
Linvi

Viewing all articles
Browse latest Browse all 4126

Trending Articles



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