title: Array element is maybe not set
body: <p>In this method below I set string smdrext to tmp[3]. However, tmp[3] seems to sometimes be empty because I get "Index was outside the bounds of the array.". Before I set it, can I change that it really exist to make sure the program does not halt again due to this?</p>
  
  <pre><code>public void WriteToCSV(string line, string path)
  {
  
      string[] tmp = line.Split(',');
      string smdrext = tmp[3];
  
      if (ext.Contains(Convert.ToString(smdrext)))
      {
  
        File.AppendAllText(path, line + "\n");
  
      }
  
  }
  </code></pre>