Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.
This repository was 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

Description

@sflanker

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().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions