title: Checking for empty or null List<string>
body: <p>I have a List where sometimes it is empty or null. I want to be able to check if it contains any List-item and if not then add an object to the List.</p>
  
  <pre><code> // I have a list, sometimes it doesn't have any data added to it
      var myList = new List&lt;object&gt;(); 
   // Expression is always false
      if (myList == null) 
          Console.WriteLine("List is never null"); 
      if (myList[0] == null) 
          myList.Add("new item"); 
      //Errors encountered:  Index was out of range. Must be non-negative and less than the size of the collection.
      // Inner Exception says "null"
  </code></pre>