Merge pull request #5420 from tamasvajk/feature/fix-nullable-warning

C#: Fix nullable warning
This commit is contained in:
Tamás Vajk
2021-03-17 12:16:15 +01:00
committed by GitHub

View File

@@ -625,7 +625,14 @@ namespace Semmle.Extraction.CSharp
{
try
{
return symbol.Accept(new Populators.Symbols(cx));
var entity = symbol.Accept(new Populators.Symbols(cx));
if (entity is null)
{
cx.ModelError(symbol, $"Symbol visitor returned null entity on symbol: {symbol}");
}
#nullable disable warnings
return entity;
#nullable restore warnings
}
catch (Exception ex) // lgtm[cs/catch-of-all-exceptions]
{