diff --git a/AutoTx-Updater/Update-Service.ps1 b/AutoTx-Updater/Update-Service.ps1
index 33da4c604507d186eed7ec81901f86c9b0ff7066..f008aacbee7f0d36660c04f4507465980ce4d40a 100644
--- a/AutoTx-Updater/Update-Service.ps1
+++ b/AutoTx-Updater/Update-Service.ps1
@@ -260,6 +260,12 @@ function Copy-ServiceFiles {
             Where-Object {$_ -match $Pattern} |
             Sort-Object |
             Select-Object -Last 1
+        
+        if ([string]::IsNullOrEmpty($PkgDir)) {
+            Write-Host "ERROR: couldn't find package matching '$($Pattern)'!"
+            Exit
+        }
+
         Stop-MyService "Trying to update service using package [$($PkgDir)]."
         Write-Verbose "Update source package: $($PkgDir)"
         Copy-Item -Recurse -Force -ErrorAction Stop `