Build: Fix a check to avoid null argument in case 'vcvarsall.bat' is absent (#7218)

This commit is contained in:
PetSerAl
2018-07-02 10:41:03 -07:00
committed by Dongbo Wang
parent c43ae6a110
commit b12dce27ff
+1 -1
View File
@@ -225,7 +225,7 @@ function Start-BuildNativeWindowsBinaries {
$vcvarsallbatPath = (Get-ChildItem $vcPath -Filter vcvarsall.bat -Recurse -File | Select-Object -First 1).FullName
}
if ((Test-Path -Path $vcvarsallbatPath) -eq $false) {
if ([string]::IsNullOrEmpty($vcvarsallbatPath) -or (Test-Path -Path $vcvarsallbatPath) -eq $false) {
throw "Could not find Visual Studio vcvarsall.bat at $vcvarsallbatPath. Please ensure the optional feature 'Common Tools for Visual C++' is installed."
}