Null Reference in file
<p>I am getting and error on this line:</p>

<pre><code>String selectedValue = this.employeeList.SelectedValue.ToString();
</code></pre>

<p>The error I am getting is </p>

<blockquote>
  <p>NullReferenceException was unhandled. </p>
</blockquote>

<p>What does this mean? Can someone help me understand why I am getting this error.  Down below is the whole code.</p>

<pre><code>String filePath = this.txtFilePath.Text;
if (!String.IsNullOrEmpty(filePath))
{
    MessageBox.Show("No file path specified");
}

if (this.employeeList.SelectedIndex != -1)
{
    String selectedValue = this.employeeList.SelectedValue.ToString();
    using (StreamWriter writer = new StreamWriter(filePath, true))
    {
        writer.WriteLine(selectedValue);
    }
}
else
{
    MessageBox.Show("No item selected");
}
</code></pre>
