From dd98de858d4c7fc69af435753989f550033710c6 Mon Sep 17 00:00:00 2001 From: Bernd Baumanns Date: Thu, 19 Nov 2020 09:52:55 +0100 Subject: [PATCH 1/2] ILSpy should not crash if fullName contains no "/" - no version info --- ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs b/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs index 30e967977..6f060c01d 100644 --- a/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs +++ b/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs @@ -44,7 +44,14 @@ namespace ICSharpCode.Decompiler.Metadata { var parts = fullName.Split('/'); this.Name = parts[0]; - this.Version = parts[1]; + if (parts.Length > 1) + { + this.Version = parts[1]; + } else + { + this.Version = ""; + } + this.Type = type; this.Path = path; this.RuntimeComponents = runtimeComponents ?? Empty.Array; From ea699b0da000219ab07cc2898267d788de4a3118 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Tue, 24 Nov 2020 19:19:37 +0100 Subject: [PATCH 2/2] Fix formatting. --- ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs b/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs index 6f060c01d..e2038e16b 100644 --- a/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs +++ b/ICSharpCode.Decompiler/Metadata/DotNetCorePathFinder.cs @@ -47,11 +47,12 @@ namespace ICSharpCode.Decompiler.Metadata if (parts.Length > 1) { this.Version = parts[1]; - } else + } + else { this.Version = ""; } - + this.Type = type; this.Path = path; this.RuntimeComponents = runtimeComponents ?? Empty.Array;