From 981401a206862642ab63f21967fa6f88c8543c64 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 22 Oct 2019 23:15:55 +0200 Subject: [PATCH] Fix #1750: DotNetCorePathFinder should not crash if a package is missing Fix #1757: Error decompiling .NET Core 3.0 assembly in Linux --- ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs b/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs index 91937943b..42c32c4ef 100644 --- a/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs +++ b/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs @@ -135,6 +135,8 @@ namespace ICSharpCode.Decompiler.Metadata return null; var basePaths = RuntimePacks.Select(pack => Path.Combine(dotnetBasePath, "shared", pack)); foreach (var basePath in basePaths) { + if (!Directory.Exists(basePath)) + continue; var closestVersion = GetClosestVersionFolder(basePath, version); if (File.Exists(Path.Combine(basePath, closestVersion, name.Name + ".dll"))) { return Path.Combine(basePath, closestVersion, name.Name + ".dll");