Why do I get a NullReferenceException here?
I also tried to use a static constructor but that didn't help either. When I put a breakpoint within the method I only see the "Command c" variables but not the variables for this static class.
static class TableManager
{
public static Dictionary<Guid, Table.AbstractTable> Tables = new Dictionary<Guid, AbstractTable>();
public static bool CreateTable(Command c)
{
if (!Tables.ContainsKey(c.Table.TableID))
{
//Do magic
return true
}
else
{
//Table already exists, return false.
return false;
}
}
}