Skip to content

Commit

Permalink
Avoid spamming log with location error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed Mar 4, 2024
1 parent 83bf68c commit 0cb8f4b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ModTekPreloader/Logging/AssemblyTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,15 @@ private static void ProcessAssembly(Assembly assembly)
return;
}

if (s_assembliesLoaded.Contains(assembly))
if (!s_assembliesLoaded.Add(assembly))
{
return;
}

s_assembliesLoaded.Add(assembly);

var locationOrName = AssemblyUtils.GetLocationOrName(assembly);
File.AppendAllText(Paths.AssembliesLoadedLogPath, CSharpUtils.AsTextListLine(locationOrName));

if (!Path.IsPathRooted(assembly.Location))
if (assembly.IsDynamic || !Path.IsPathRooted(assembly.Location))
{
return;
}
Expand Down

0 comments on commit 0cb8f4b

Please sign in to comment.