From fa9d5e228b13e2e51751c8055b2e58f3a0301fd5 Mon Sep 17 00:00:00 2001 From: freddydk Date: Fri, 25 Nov 2022 11:54:56 +0100 Subject: [PATCH] test parameter before usage --- ContainerHandling/New-NavImage.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ContainerHandling/New-NavImage.ps1 b/ContainerHandling/New-NavImage.ps1 index e1ffd6ae5..759329b4d 100644 --- a/ContainerHandling/New-NavImage.ps1 +++ b/ContainerHandling/New-NavImage.ps1 @@ -525,7 +525,7 @@ try { if (!$skipDatabase) { $dbPath = Join-Path $navDvdPath "SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\ver\Database" New-Item $dbPath -ItemType Directory | Out-Null - if (Test-Path $databaseBackupPath -PathType Leaf) + if (($databaseBackupPath) -and (Test-Path $databaseBackupPath -PathType Leaf)) { Write-Host "Using database backup from $databaseBackupPath" $databasePath = $databaseBackupPath