The problem here is that root
is currently null
and you're getting an exception trying to set it's members. Given that BTree()
is a constructor and root
a presumably instance field, you need to initialize it before use
public BTree() {
root = new Artist<T>();
root.Name = default(T);
root.Members = default(T);
}
EDIT
Updated based on PasteBin code