Skip to content

Commit 089999d

Browse files
committed
C#: Fix logging in assets file parsing
1 parent c514d36 commit 089999d

File tree

1 file changed

+4
-4
lines changed
  • csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching

1 file changed

+4
-4
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/Assets.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ private void AddFrameworkDependencies(JObject json, string jsonPath)
189189
/// (together with used package information) required for compilation.
190190
/// </summary>
191191
/// <returns>True if parsing succeeds, otherwise false.</returns>
192-
public bool TryParse(string json)
192+
public bool TryParse(string json, string? jsonPath = null)
193193
{
194194
try
195195
{
196196
var obj = JObject.Parse(json);
197-
AddPackageDependencies(obj, json);
198-
AddFrameworkDependencies(obj, json);
197+
AddPackageDependencies(obj, jsonPath ?? json);
198+
AddFrameworkDependencies(obj, jsonPath ?? json);
199199
return true;
200200
}
201201
catch (Exception e)
@@ -228,7 +228,7 @@ public void AddDependencies(string asset)
228228
{
229229
if (TryReadAllText(asset, logger, out var json))
230230
{
231-
TryParse(json);
231+
TryParse(json, asset);
232232
}
233233
}
234234

0 commit comments

Comments
 (0)