In the following code, R# 6.1.1 marks the "if (hash == null)" test as "always false", and the content of the if block as unreachable:
using (var hash = HashAlgorithm.Create(algorithmName))
if (null == hash)
throw new ArgumentException("Invalid hash algorithm", "algorithmName");
Looking at the
MSDN documentation for .NET 3.5 or higher:
A new instance of the specified hash algorithm, or null if hashName is not a valid hash algorithm.
I appreciate this probably won't get fixed for v6, since v7 has now been released. Can anyone confirm whether this is fixed in v7?