I am trying to add the content of my BindingList into a txt file. However, I always get the following error:

```
System.NullReferenceException: Object reference not set to an instance of an object. 

```

What am I doing wrong? The text file is empty if that helps.

**Code:**

```
BindingList<Student> StudentCollection = new BindingList<Student>();

private void btnAddStudent_Click(object sender, EventArgs e)
{
    Student StudentSave = new Student
    {
        ID = txtStudentID.Text,
        FirstName = txtFirstName.Text,
        LastName = txtLastName.Text,
        Age = nudAge.Value,
        Height = nudHeight.Value,
        Schoolclass = txtSchoolClass.Text,
        Gender = cbxGender.Text,
    };

    cbxStudentIDs.DataSource = StudentCollection;
    cbxStudentIDs.DisplayMember = "ID";
    StudentCollection.Add(StudentSave);

}
public class Student
{
    public string ID { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public decimal Age { get; set; }
    public decimal Height { get; set; }
    public string Schoolclass { get; set; }
    public string Gender { get; set; }

}

private void Form1_Load(object sender, EventArgs e)
{
    string studentCollectionString = File.ReadAllText(FilePath);
    StudentCollection = JsonConvert.DeserializeObject<BindingList<Student>>(studentCollectionString);
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    string studentCollectionString = JsonConvert.SerializeObject(StudentCollection);
    File.WriteAllText(FilePath, studentCollectionString);
}

```