Here is my code:
var reddit = new Reddit();
var authenticated = false;
try
{
var user = reddit.LogIn("uname", "password");
authenticated = reddit.User != null;
}
catch (AuthenticationException)
{
Console.WriteLine("Incorrect login.");
authenticated = false;
}
//RedditSharp.Things.Thing.Parse.
var subreddit = reddit.RSlashAll;
var allPost = subreddit.Search("domain").Take(3);
foreach(var p in allPost)
{
Console.WriteLine(p.Comments);
var comment = p.Comment("aaaaaaaaaaaaaaaaaa");
comment.Distinguish(RedditSharp.Things.VotableThing.DistinguishType.Moderator);
}
I am getting an unhandled exception of type
An unhandled exception of type 'System.NullReferenceException'occurred in RedditSharp.dll Additional information: Object reference not set to an instance of an object.
occurred in
var comment = p.Comment("aaaaaaaaaaaaaaaaaa");