Skip to content

Commit b2d6491

Browse files
committed
Null-conditional operator for versions
1 parent 6b4976d commit b2d6491

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Cli/dotnet/Commands/Tool/Install/ParseResultExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal static class ParseResultExtension
1212
{
1313
public static VersionRange GetVersionRange(this ParseResult parseResult)
1414
{
15-
string packageVersion = parseResult.GetValue(ToolInstallCommandParser.PackageIdentityArgument).Version.ToString() ??
15+
string packageVersion = parseResult.GetValue(ToolInstallCommandParser.PackageIdentityArgument).Version?.ToString() ??
1616
parseResult.GetValue(ToolInstallCommandParser.VersionOption);
1717
bool prerelease = parseResult.GetValue(ToolInstallCommandParser.PrereleaseOption);
1818

0 commit comments

Comments
 (0)