From 44a392787c57af120b047c66afbdc4f030adc9cf Mon Sep 17 00:00:00 2001 From: KnifMelti Date: Thu, 20 Apr 2023 22:20:17 +0200 Subject: [PATCH] Fixing a NULL if Mods not in AzureBlob --- Winget-AutoUpdate/Winget-Upgrade.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Winget-AutoUpdate/Winget-Upgrade.ps1 b/Winget-AutoUpdate/Winget-Upgrade.ps1 index 54d226b..2ed35a1 100644 --- a/Winget-AutoUpdate/Winget-Upgrade.ps1 +++ b/Winget-AutoUpdate/Winget-Upgrade.ps1 @@ -152,7 +152,12 @@ if (Test-Network) { if ($WAUConfig.WAU_ModsPath) { $ModsPathClean = $($WAUConfig.WAU_ModsPath.TrimEnd(" ", "\", "/")) Write-ToLog "WAU uses External Mods from: $ModsPathClean" - $NewMods, $DeletedMods = Test-ModsPath $ModsPathClean $WAUConfig.InstallLocation.TrimEnd(" ", "\") $WAUConfig.WAU_AzureBlobSASURL.TrimEnd(" ") + if ($WAUConfig.WAU_AzureBlobSASURL) { + $NewMods, $DeletedMods = Test-ModsPath $ModsPathClean $WAUConfig.InstallLocation.TrimEnd(" ", "\") $WAUConfig.WAU_AzureBlobSASURL.TrimEnd(" ") + } + else { + $NewMods, $DeletedMods = Test-ModsPath $ModsPathClean $WAUConfig.InstallLocation.TrimEnd(" ", "\") + } if ($ReachNoPath) { Write-ToLog "Couldn't reach/find/compare/copy from $ModsPathClean..." "Red" $Script:ReachNoPath = $False