LGTM.com - false positive C# nullable types/linq Where then Select
Aberta
C#
false-positive
- Linguagem predominante
- CodeQL
- Estrelas
- 10.1k
- Forks
- 2.1k
- Merge médio
- 2d 15h
- PRs com merge (30d)
- 141
Descrição
**Description of the false positive**
An earlier lamda uses `Where` with nullable Type (int?) `HasValue`. Later lamda dereferences `ID.Value`. It is a false positive because the first lamda ensures there are no null values.
```csharp
// the cohorts in the database
var available = ExtractableCohort.GetImportableCohortDefinitions(ect).Where(c=>c.ID.HasValue).ToArray();
[...]
// new ones we don't know about yet
available = available.Where(c => !existing.Contains(c.ID.Value)).ToArray();
```
https://lgtm.com/projects/g/HicServices/RDMP/rev/pr-51dd5b87e2dee7ed707f8a2b4855b01ad10e3ca0
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.