Skip to content

Commit

Permalink
Fix NRE in RuntimeEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
am11 committed Oct 31, 2020
1 parent 99a9869 commit b82a223
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/Cli/Microsoft.DotNet.Cli.Utils/RuntimeEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,25 @@ private static DistroInfo LoadDistroInfoFromIllumos()
switch (versionDescription)
{
case string version when version.StartsWith("omnios"):
result.Id = "OmniOS";
result.VersionId = version.Substring("omnios-r".Length, 2); // e.g. 15
result = new DistroInfo
{
Id = "OmniOS",
VersionId = version.Substring("omnios-r".Length, 2) // e.g. 15
};
break;
case string version when version.StartsWith("joyent"):
result.Id = "SmartOS";
result.VersionId = version.Substring("joyent_".Length, 4); // e.g. 2020
result = new DistroInfo
{
Id = "SmartOS",
VersionId = version.Substring("joyent_".Length, 4) // e.g. 2020
};
break;
case string version when version.StartsWith("illumos"):
result.Id = "OpenIndiana";
// version-less
result = new DistroInfo
{
Id = "OpenIndiana"
// version-less
};
break;
}

Expand Down

0 comments on commit b82a223

Please sign in to comment.