Skip to content

Commit 091c062

Browse files
committed
fix(core): check $deprecated_dir exists before accessing it
1 parent 3bee815 commit 091c062

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- **schema:** Add missing `hash.mode` value `github` ([#6533](https://github.com/ScoopInstaller/Scoop/issues/6533))
2929
- **core:** Skip NO_JUNCTION logic when $app is 'scoop' in `currentdir` function ([#6541](https://github.com/ScoopInstaller/Scoop/issues/6541))
3030
- **core:** Fix substitute handling of substring keys ([#6561](https://github.com/ScoopInstaller/Scoop/issues/6561))
31+
- **core:** Check `$deprecated_dir` exists before accessing it ([#6573](https://github.com/ScoopInstaller/Scoop/issues/6573))
3132

3233
### Code Refactoring
3334

lib/core.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,9 @@ function app_status($app, $global) {
552552
$status.hold = ($install_info.hold -eq $true)
553553

554554
$deprecated_dir = (Find-BucketDirectory -Name $install_info.bucket -Root) + "\deprecated"
555-
$status.deprecated = (Get-ChildItem $deprecated_dir -Filter "$(sanitary_path $app).json" -Recurse -ErrorAction Ignore).FullName
555+
if (Test-Path $deprecated_dir) {
556+
$status.deprecated = (Get-ChildItem $deprecated_dir -Filter "$(sanitary_path $app).json" -Recurse).FullName
557+
}
556558

557559
$manifest = manifest $app $install_info.bucket $install_info.url
558560
$status.removed = (!$manifest)

0 commit comments

Comments
 (0)