public void UpdateCredentialSelect(ClientCredentials credential, bool selected)
{
onsSelectedCredentials.RemoveAll(x => x.Equals(null));
if (selected && !onsSelectedCredentials.Exists(x => x.name.Equals(credential.name)))
{
onsSelectedCredentials.Add(credential);
}
else
{
onsSelectedCredentials.Remove(credential);
}
onsSecurityScreen.UpdateDynamicItems();
onsSecurityScreen.UpdateSelectAllCheckmark();
}
Running through Coverity reports and it is having issues with the "onsSelectedCredentials.RemoveAll(x => x.Equals(null));" line here, stating "check_after_deref: Null-checking x suggests that it may be null, but it has already been dereferenced on all paths leading to the check." The purpose of that line of code is to read through the current values in the list and strip out any that have become null, there's no null check happening as far as I can tell. Is this a false positive from Coverity or should I do something to fix this?