SonarLint for C# doesn't complain about Nullable access

  • Operating system: Windows 10
  • SonarLint plugin version:
  • Programming language you’re coding in: C#
  • Is connected mode used: No
    • Connected to SonarCloud or SonarQube (and which version): No

And a thorough description of the problem / question:

I have a simple function, taking a nullable parameter:

private static bool IsTen(int? value)
	return value.Value == 10;

I can call it with a null value, like this:
var gotTen = IsTen(null);

I expected SonarLint to complain about the “value.Value” access, in the IsTen function, but it doesn’t.
Tried in a separate project too, just to check nobody disabled the rule by mistake.
Is this a bug? If not, please consider it a feature request.

Hey there.

Can you clarify which rule you’re discussing, as noted in this post?