title: Null Reference Exception C# get set
body: <p>I think that I am misunderstanding the purpose of a get; set; in C#. I have a list of doubles that I am trying to populate and I am using the following code...Both of these are in the same class and when I try to run this, I get a Null reference exception when trying to populate the list. What exactly am I misunderstanding?</p>
  
  <pre><code>public List&lt;double&gt; NewData
  { get; set; }
  
  public InfoFile(String fileName, String groupName)
  {
  
      this.group = groupName;
      test = File.ReadAllLines(fileName);
      FileInfo label = new FileInfo(fileName);
      this.name = Path.GetFileName(fileName);
      isDrawn = false;
  
      for (int t = 2; t &lt; test.Length; t++)
      {
          NewData.Add(double.Parse(test[t].Substring(6, 4)));
      }
  }
  </code></pre>