Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] GetPlan of empty collection throw exception #1685

Closed
mikhail-khalizev opened this issue May 13, 2020 · 1 comment
Closed

[BUG] GetPlan of empty collection throw exception #1685

mikhail-khalizev opened this issue May 13, 2020 · 1 comment
Labels

Comments

@mikhail-khalizev
Copy link

Version
5.0.8

Describe the bug
GetPlan method of empty collection throw System.InvalidOperationException : Sequence contains no elements.

Code to Reproduce

public class StateModel
{
    [BsonId]
    public int Id { get; set; }
}

[Fact]
public void MyTest()
{
    using (var db = new LiteDatabase(":memory:"))
    {
        var col = db.GetCollection<StateModel>("col");
        var query = col.Query();
        var plan = query.GetPlan();
    }
}

Expected behavior
Exception is not thrown.

@lbnascimento
Copy link
Contributor

@mikhail-khalizev This issue has been fixed in master and its fix will be present in the next incremental release.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants