mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
C#: Fix compiler warning of possible null de-reference.
This commit is contained in:
@@ -91,7 +91,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
// The current argument is not named
|
||||
// so the previous ones were also not named
|
||||
// so the child index matches the parameter index.
|
||||
isParamsParameter = Symbol?.AttributeConstructor?.Parameters[childIndex].IsParams == true;
|
||||
isParamsParameter = Symbol.AttributeConstructor?.Parameters[childIndex].IsParams == true;
|
||||
argSyntax = ctorArguments[childIndex];
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
Position.Span.Start.Line + 1, Position.Span.Start.Character + 1,
|
||||
Position.Span.End.Line + 1, Position.Span.End.Character);
|
||||
|
||||
var mapped = Symbol!.GetMappedLineSpan();
|
||||
var mapped = Symbol.GetMappedLineSpan();
|
||||
if (mapped.HasMappedPath && mapped.IsValid)
|
||||
{
|
||||
var mappedLoc = Create(Context, Location.Create(mapped.Path, default, mapped.Span));
|
||||
|
||||
Reference in New Issue
Block a user