title: c# check IEnumerable for null
body: <p>I am trying to check a type of <code>IEnuemrable&lt;SystemUser&gt;</code> for null.</p>
  
  <p>I am using this piece of code</p>
  
  <pre><code>            var systemUsers = newActActivityPersons.SelectMany(x =&gt; x.Person.SystemUsers);
              if (systemUsers == null || !systemUsers.Any()) return ;
  </code></pre>
  
  <p>That isn't working. When I try to do something like <code>systemUsers.ToArray()</code> or  <code>systemUsers.ToList()</code> I get a null exception. How can I check this for errors?</p>