Linq Query with .Any condition returns nullreference exception
===

I have the following function that returns results from the database based on LINQ Expressions:

    IQueryable<TEntity> FindAll<TEntity>(System.Linq.Expressions.Expression<Func<TEntity, bool>> expression)

When I try pulling data from the function while using the .Any function from a list I get a null reference exception.
However when I pull the data without that specific condition and use the same .Any function in a for each loop everything works correctly.

Here is the call trying to use the .Any function which does not work:

     var ppcReports = repository.FindAll<PPCReport>(x => x.ClientId == clientId && (campaigns.Any(c=> c.Id == x.CampaignId))).ToList();

And the way it does work properly:

    var ppcReports = repository.FindAll<PPCReport>(x => x.ClientId == clientId).ToList();
 
                foreach (var item in ppcReports)
                {
                    if (campaigns.Any(c => c.Id == item.CampaignId))
                    {
                        // do something
                    }

                }

I was wondering why was this happening, am I doing something wrong is it just not possible to filter the results before the query finished?

