mirror of
https://github.com/github/codeql.git
synced 2026-04-22 07:15:15 +02:00
Merge pull request #5420 from tamasvajk/feature/fix-nullable-warning
C#: Fix nullable warning
This commit is contained in:
@@ -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]
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user