Skip to content

Commit

Permalink
Merge pull request #1309 from nunit/fixNullVersion
Browse files Browse the repository at this point in the history
Fix for #1307
  • Loading branch information
OsirisTerje authored Jan 18, 2023
2 parents 76330ac + 3924b98 commit 67fbaeb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private Assembly OnResolving(AssemblyLoadContext context, AssemblyName name)
return _loadContext.LoadFromAssemblyPath(assemblyPath);
}
}

if (name.Version == null)
return null;
foreach(string frameworkDirectory in AdditionalFrameworkDirectories)
{
var versionDir = FindBestVersionDir(frameworkDirectory, name.Version);
Expand Down Expand Up @@ -108,7 +109,8 @@ private static string GetDotNetInstallDirectory()

private static string FindBestVersionDir(string libraryDir, Version targetVersion)
{
string target = targetVersion.ToString();
if (targetVersion == null)
return null;
Version bestVersion = new Version(0,0);
foreach (var subdir in Directory.GetDirectories(libraryDir))
{
Expand Down

0 comments on commit 67fbaeb

Please sign in to comment.