mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C#: Fix logging in assets file parsing
This commit is contained in:
@@ -189,13 +189,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
/// (together with used package information) required for compilation.
|
||||
/// </summary>
|
||||
/// <returns>True if parsing succeeds, otherwise false.</returns>
|
||||
public bool TryParse(string json)
|
||||
public bool TryParse(string json, string? jsonPath = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var obj = JObject.Parse(json);
|
||||
AddPackageDependencies(obj, json);
|
||||
AddFrameworkDependencies(obj, json);
|
||||
AddPackageDependencies(obj, jsonPath ?? json);
|
||||
AddFrameworkDependencies(obj, jsonPath ?? json);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -228,7 +228,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
{
|
||||
if (TryReadAllText(asset, logger, out var json))
|
||||
{
|
||||
TryParse(json);
|
||||
TryParse(json, asset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user