S2589 has not to be shown on List.Count > 0 if List could be empty

Please provide

  • Operating system: Win 11
  • Visual Studio version: 17.11.5
  • SonarLint plugin version: 8.5.0.10497
  • Programming language you’re coding in: c#
  • Is connected mode used: no

And a thorough description of the problem / question:

The List could by empty but sonar shows possible S2589

Hi Robert,

I can confirm that this is a FP. It has been previously reported here.
I can also let you know that it will be fixed in the next release.

Thanks for reporting this issue!

2 Likes