Misleading error message when NullReferenceException thrown within Comparer

We’ve got an error messgae from custom comparer:
IComparer (or the IComparable methods it relies upon) did not
return zero when Array.Sort called x. CompareTo(x).
 
After investigation it was found, that the error was caused by NullReferenceException,
 thrown within Comparer.
I’ve suggested to Microsoft , that the actual NullReferenceException error message should be shown instead of this misleading one.
See also similar feedback
 
Advertisements