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