Skip to content

InvalidOperationException during build #78

@FantasyTeddy

Description

@FantasyTeddy

Description

In some of my projects I get the following error when building:

CSC : warning AD0001: Analyzer 'FluentAssertions.Analyzers.CollectionShouldHaveCountAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'This operation does not apply to an empty instance.'.

My guess is that the following IsEmpty check should happen before Peek():

var member = Members.Peek();
if (Members.IsEmpty)
{
// no op
}

If you need me to provide more information, let me know how and I will see what I can do.

Versions

  • FluentAssertions.Analyzers 0.11.3
  • .NET Framework 4.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions