We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents df8c399 + 61973c3 commit 97bbb12Copy full SHA for 97bbb12
1 file changed
csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs
@@ -492,8 +492,18 @@ public static string GetCSharpArgsLogPath(string hash) =>
492
/// <summary>
493
/// Gets a list of all `csharp.{hash}.txt` files currently written to the log directory.
494
/// </summary>
495
- public static IEnumerable<string> GetCSharpArgsLogs() =>
496
- Directory.EnumerateFiles(GetCSharpLogDirectory(), "csharp.*.txt");
+ public static IEnumerable<string> GetCSharpArgsLogs()
+ {
497
+ try
498
499
+ return Directory.EnumerateFiles(GetCSharpLogDirectory(), "csharp.*.txt");
500
+ }
501
+ catch (DirectoryNotFoundException)
502
503
+ // If the directory does not exist, there are no log files
504
+ return Enumerable.Empty<string>();
505
506
507
508
private static string GetCSharpLogDirectory()
509
{
0 commit comments