I am currently working with TrelloNet to develop my own Trello organizer application. Started with two piece of codes shown below ("xxxx" is my own authentication code and application key, masked for privacy purpose):
using System;
using TrelloNet;
class Program
{
static void Main(string[] args)
{
ITrello trello = new Trello("xxxx");
trello.Authorize("xxxx");
var myBoard = trello.Boards.Add("My Board");
}
}
This code worked, a "My Board" board was successfully added. But the second slightly modified code met an exception.
using System;
using TrelloNet;
class Program
{
static void Main(string[] args)
{
ITrello trello = new Trello("xxxx");
trello.Authorize("xxxx");
Member me = trello.Members.Me();
Console.WriteLine(me.FullName); //exception poped up here.
}
}
After execution, there came an exception poped out at the line Console.WriteLine(me.FullName);
, the exception is
NullReferenceException was unhandled
.An unhandled exception of type 'System.NullReferenceException' occurred in TrelloOrganizer.exe Additional information: Object reference not set to an instance of an object.
object trello is indeed an instance of an object, why did I get this exception?
Thanks