C#: False positive variable is null on at least one execution path

I have a piece of code that looks like this:

public int Compare(... left, ... right)
{
  string leftName = ...;
  string rightName = ...;
  if (string.Equals(leftName, rightName))
    return 0;

  if (leftName == null)
  {
    ERROR: 'rightName' is null on at least one execution path.
    if (rightName.EndsWith("module.js"))

To me we are in one of two cases here:

  1. SonarQube simply doesn’t know, but then it shouldn’t report it with the wording it does, instead it should be a warning with “rightName may be null”…
  2. SonarQube think it knows that rightName can be null but actually gets that completely wrong.

IF leftName is null in this block, rightName cannot be null, otherwise the “string.Equals” would have returned from the method, hence we KNOW that rightName holds a value in this context.

(This is even verified with a Unit test)