title: When would SqlCommand.ExecuteReader() return null?
body: <p>When using calling the <code>SqlCommand.ExecuteReader()</code> method, ReSharper tells me I have a possible NullReference exception when I use the SqlDataReader object afterwards.</p>
  
  <p>So with the following code:</p>
  
  <pre><code>using (SqlConnection connection = GetConnection())
  {
      using (SqlCommand cmd = connection.CreateCommand())
      {
          cmd.CommandText = ; //snip
  
          using (SqlDataReader reader = cmd.ExecuteReader())
          {
              while (reader.Read())
              {
                  //snip
              }
          }
      }
  }
  </code></pre>
  
  <p>The <code>while (reader.Read())</code> line is underlined.</p>
  
  <p>My question is when would the reader object ever be null? I've never come across it and the documentation doesn't mention that it could be. Should I be checking if it's null or is it safe to ignore?</p>
  
  <p>And why would ReSharper think that it could be null, when for example it lets me use the SqlCommand without recommending it be checked for null? I'm guess there's an attribute on the ExecuteReader method.</p>