Open petekay opened 3 years ago
Sorry for the delay. I stepped away for a few months. Based on your output, my guess is the problem is with NewPostsUpdated, since that's the one not appearing (it would help if you would test them individually so we can confirm this). ArgumentNullException suggests that one of the two args is null when it shouldn't be.
Could you run a debug and tell me what args are getting passed in the event?
Here's where the method invocation actually occurs in SubredditPosts.cs:
internal virtual void OnNewUpdated(PostsUpdateEventArgs e)
{
NewUpdated?.Invoke(this, e);
}
I doubt the problem is with our sender (we're just passing this
and it's definitely not null). So let's examine where e
is coming from. In SubredditPosts.cs:
// Event handler to alert the calling app that the list has changed. --Kris
PostsUpdateEventArgs args = new PostsUpdateEventArgs
{
NewPosts = newList,
OldPosts = oldList,
Added = added,
Removed = removed
};
TriggerUpdate(args, type);
TriggerUpdate basically just does this:
OnNewUpdated(args);
So as you can see, we're passing args and it's also definitely not null. I haven't been able to reproduce this issue, either, and all the tests are still passing. Your code also looks fine. This leads me to believe that the issue might be environment-related, though I'm not exactly sure how at the moment. Neither of those values should be null but we have that exception which says otherwise.
It's also possible that this is a red herring and the ArgumentNullException is being triggered by something else. I can't determine that without a full debug, which I'll need you to perform since I can't repro the issue on my end.
TL;DR: Please try running this in debug mode so we can get more useful information, like a stack trace on that exception.
Hi, I installed the Package today, and I am trying to stream some comments/posts for two subreddits. I'm getting the following exception all the time in the console: Exception thrown: 'System.ArgumentNullException' in System.Private.CoreLib.dll
this is the code to replicate it:
from outside I'm calling the subclass:
after some time, I get the async. messages for the Posts or Comments, but it look like this: (like 1-2 exceptions every second).