Fix crash on clearing Start menu pinned apps for all users (#447)

As reported in #445
This commit is contained in:
Jeffrey
2026-02-04 10:26:55 +01:00
committed by GitHub
parent 6a1a091a87
commit afdb66b5d4

View File

@@ -2228,12 +2228,12 @@ function GetUserDirectory {
$exitIfPathNotFound = $true
)
if (-not (CheckIfUserExists -userName $userName)) {
Write-Error "User $userName does not exist on this system"
AwaitKeyToExit
}
try {
if (-not (CheckIfUserExists -userName $userName) -and $userName -ne "*") {
Write-Error "User $userName does not exist on this system"
AwaitKeyToExit
}
$userDirectoryExists = Test-Path "$env:SystemDrive\Users\$userName"
$userPath = "$env:SystemDrive\Users\$userName\$fileName"