File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -492,8 +492,18 @@ public static string GetCSharpArgsLogPath(string hash) =>
492492 /// <summary>
493493 /// Gets a list of all `csharp.{hash}.txt` files currently written to the log directory.
494494 /// </summary>
495- public static IEnumerable<string> GetCSharpArgsLogs() =>
496- Directory.EnumerateFiles(GetCSharpLogDirectory(), "csharp.*.txt");
495+ public static IEnumerable<string> GetCSharpArgsLogs()
496+ {
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+ }
497507
498508 private static string GetCSharpLogDirectory()
499509 {
You can’t perform that action at this time.
0 commit comments