Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Call to FirstOrDefault(Func<T, bool> predicate) when the predicate matches no result raises NullReferenceException. #7

Open
sflanker opened this issue Jun 19, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@sflanker
Copy link
Member

See test case:

[Fact(Skip = "BUG: FirstOrDefault generates NullReferenceException when there are no results.")]
public override void FirstOrDefault_NoResults() {
}

Expected behavior: FirstOrDefault should return default(T)

It is unknown whether this issue is specific to the FirstOrDefault overload that takes a predicate, or would also occur when calling .Where(predicate).FirstOrDefault().

@sflanker sflanker added the bug Something isn't working label Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant