There is a ConcurrentDirectory instance like below
readonly ConcurrentDictionary<string, SessionPayload> _map
= new ConcurrentDictionary<string, SessionPayload>(StringComparer.InvariantCultureIgnoreCase);
And there is a thread check all the instances every several minutes
SessionPayload[] sessions = _map.Values.ToArray();
foreach (SessionPayload session in sessions) // <-- NullReferenceException from this line
{
//...
}
I don't understand why that line throws NullReferenceException. Isn't Values thread-safe?
Br