title: System.NullReferenceException: When adding item to a list
body: <p>I am having an issue when trying to add an item to a list. I see many questions but I still don't get it in my case. 
  This is my definition : </p>
  
  <pre><code>public class DBStatus
      {
          [DataMember]
          public DBOperation Type { get; set; }
          [DataMember]
          public List&lt;DBMessageType&gt; Message { get; set; }
          [DataMember]
          public List&lt;string&gt; InnerException { get; set; }
      }
  </code></pre>
  
  <p>I declared this class and trying to add an item.</p>
  
  <pre><code>private void button19_Click_1(object sender, EventArgs e)
      {
          DBStatus dbstst = new DBStatus();
          dbstst.Message.Add(DBMessageType.INVALID_OR_EXPIRED_FUNCTION_REQUEST);
          dbstst.InnerException.Add("testing code");
  
          int k = 0;
      }
  </code></pre>
  
  <p>I get System.NullReferenceException when adding the items.</p>
  
  <p>Error message: "System.NullReferenceException: 'Object reference not set to an instance of an object.'"</p>
  
  <p>I know my last two list items are null post declaration, why can not I add ?</p>
  
  <p>Any help is appreciated.</p>
  
  <p>thanks,
  PG </p>