Skip to content

Commit 6e8c46b

Browse files
TylerLeonhardtrjmholt
authored andcommitted
[Ignore] add null check for version
1 parent 9f5ef28 commit 6e8c46b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PowerShellEditorServices.build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, Packa
198198
# dotnet --version can return a semver that System.Version can't handle
199199
# e.g.: 2.1.300-preview-01. The replace operator is used to remove any build suffix.
200200
$version = (& $dotnetExePath --version) -replace '[+-].*$',''
201-
if ([version]$version -ge [version]$script:RequiredSdkVersion) {
201+
if ($version -and [version]$version -ge [version]$script:RequiredSdkVersion) {
202202
$script:dotnetExe = $dotnetExePath
203203
}
204204
else {

0 commit comments

Comments
 (0)