From c9d434dfbc985be918295cabe7b37fae7732b9c8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Feb 2018 17:36:59 -0800 Subject: vcpkgRemoveItem: nullcheck --- scripts/VcpkgPowershellUtils.ps1 | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scripts') diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index 4aaad3479..07270dd22 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -27,6 +27,11 @@ function vcpkgCreateParentDirectoryIfNotExists([Parameter(Mandatory=$true)][stri function vcpkgRemoveItem([Parameter(Mandatory=$true)][string]$dirPath) { + if ([string]::IsNullOrEmpty($dirPath)) + { + return + } + if (Test-Path $dirPath) { Remove-Item $dirPath -Recurse -Force -- cgit v1.2.3