This is an unexpected bug in my code. I didn't realize that C#'s nullish operator isn't a null chaining operator.
In JavaScript, this code is correct:
(colorChip?.ranks.Length ?? 0)
In C# it's wrong, since it evaluates to
((colorChip?.ranks).Length ?? 0)
Instead of nulling out the whole chain. Thus here, if `colorChip` is null, I get a null pointer error.
I can't understand why C# uses this approach. I don't see a situation in which it's beneficial.
